// Copyright 2021 ETH Zurich and University of Bologna.
// Solderpad Hardware License, Version 0.51, see LICENSE for details.
// SPDX-License-Identifier: SHL-0.51
//
// Author: Matteo Perotti <mperotti@iis.ee.ethz.ch>

#include "vector_macros.h"

int stride;

// Segment-2
void TEST_CASE1_8(void) {

  VSET(-1, e8, m1);
  volatile uint8_t INP1[] = {
      0x9f, 0xe4, 0x19, 0x20, 0x8f, 0x2e, 0x05, 0xe0, 0xf9, 0xaa, 0x71,
      0xf0, 0xc3, 0x94, 0xbb, 0xd3, 0x31, 0x4a, 0x57, 0x6b, 0x83, 0x7d,
      0x1a, 0x45, 0xb2, 0xda, 0x22, 0x56, 0x63, 0x8c, 0xf7, 0x3e, 0x6c,
      0x27, 0x74, 0x9d, 0xab, 0xcd, 0x13, 0x38, 0x5e, 0x42, 0xdf, 0x80,
      0x60, 0xa4, 0x7b, 0x0b, 0xc6, 0xad, 0x91, 0xec, 0x3c, 0x69, 0xf5,
      0x18, 0xe8, 0x6d, 0xb9, 0x82, 0x97, 0x2a, 0x51, 0x70};
  VCLEAR(v1);
  VCLEAR(v2);
  stride = 0;
  VSET(5, e8, m1);
  asm volatile("vlsseg2e8.v v1, (%0), %1" ::"r"(INP1), "r"(stride));
  VCMP_U8(1, v1, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f);
  VCMP_U8(2, v2, 0xe4, 0xe4, 0xe4, 0xe4, 0xe4);

  VCLEAR(v1);
  VCLEAR(v2);
  stride = 2;
  VSET(32, e8, m1);
  asm volatile("vlsseg2e8.v v1, (%0), %1" ::"r"(INP1), "r"(stride));
  VCMP_U8(1, v1, 0x9f, 0x19, 0x8f, 0x05, 0xf9, 0x71, 0xc3, 0xbb, 0x31, 0x57,
          0x83, 0x1a, 0xb2, 0x22, 0x63, 0xf7, 0x6c, 0x74, 0xab, 0x13, 0x5e,
          0xdf, 0x60, 0x7b, 0xc6, 0x91, 0x3c, 0xf5, 0xe8, 0xb9, 0x97, 0x51);
  VCMP_U8(2, v2, 0xe4, 0x20, 0x2e, 0xe0, 0xaa, 0xf0, 0x94, 0xd3, 0x4a, 0x6b,
          0x7d, 0x45, 0xda, 0x56, 0x8c, 0x3e, 0x27, 0x9d, 0xcd, 0x38, 0x42,
          0x80, 0xa4, 0x0b, 0xad, 0xec, 0x69, 0x18, 0x6d, 0x82, 0x2a, 0x70);

  VCLEAR(v1);
  VCLEAR(v2);
  stride = 3;
  VSET(21, e8, m1);
  asm volatile("vlsseg2e8.v v1, (%0), %1" ::"r"(INP1), "r"(stride));
  VCMP_U8(3, v1, 0x9f, 0x20, 0x05, 0xaa, 0xc3, 0xd3, 0x57, 0x7d, 0xb2, 0x56,
          0xf7, 0x27, 0xab, 0x38, 0xdf, 0xa4, 0xc6, 0xec, 0xf5, 0x6d, 0x97);
  VCMP_U8(4, v2, 0xe4, 0x8f, 0xe0, 0x71, 0x94, 0x31, 0x6b, 0x1a, 0xda, 0x63,
          0x3e, 0x74, 0xcd, 0x5e, 0x80, 0x7b, 0xad, 0x3c, 0x18, 0xb9, 0x2a);
  VCLEAR(v1);
  VCLEAR(v2);
  stride = 4;
  VSET(16, e8, m1);
  asm volatile("vlsseg2e8.v v1, (%0), %1" ::"r"(INP1), "r"(stride));
  VCMP_U8(5, v1, 0x9f, 0x8f, 0xf9, 0xc3, 0x31, 0x83, 0xb2, 0x63, 0x6c, 0xab,
          0x5e, 0x60, 0xc6, 0x3c, 0xe8, 0x97);
  VCMP_U8(6, v2, 0xe4, 0x2e, 0xaa, 0x94, 0x4a, 0x7d, 0xda, 0x8c, 0x27, 0xcd,
          0x42, 0xa4, 0xad, 0x69, 0x6d, 0x2a);
}

// Segment-3
void TEST_CASE2_8(void) {
  VSET(-1, e8, m1);
  volatile uint8_t INP1[] = {
      0x9f, 0xe4, 0x19, 0x20, 0x8f, 0x2e, 0x05, 0xe0, 0xf9, 0xaa, 0x71,
      0xf0, 0xc3, 0x94, 0xbb, 0xd3, 0x31, 0x4a, 0x57, 0x6b, 0x83, 0x7d,
      0x1a, 0x45, 0xb2, 0xda, 0x22, 0x56, 0x63, 0x8c, 0xf7, 0x3e, 0x6c,
      0x27, 0x74, 0x9d, 0xab, 0xcd, 0x13, 0x38, 0x5e, 0x42, 0xdf, 0x80,
      0x60, 0xa4, 0x7b, 0x0b, 0xc6, 0xad, 0x91, 0xec, 0x3c, 0x69, 0xf5,
      0x18, 0xe8, 0x6d, 0xb9, 0x82, 0x97, 0x2a, 0x51, 0x70};
  VCLEAR(v1);
  VCLEAR(v2);
  VCLEAR(v3);
  stride = 2;
  VSET(31, e8, m1);
  asm volatile("vlsseg3e8.v v1, (%0), %1" ::"r"(INP1), "r"(stride));
  VCMP_U8(7, v1, 0x9f, 0x19, 0x8f, 0x05, 0xf9, 0x71, 0xc3, 0xbb, 0x31, 0x57,
          0x83, 0x1a, 0xb2, 0x22, 0x63, 0xf7, 0x6c, 0x74, 0xab, 0x13, 0x5e,
          0xdf, 0x60, 0x7b, 0xc6, 0x91, 0x3c, 0xf5, 0xe8, 0xb9, 0x97);
  VCMP_U8(8, v2, 0xe4, 0x20, 0x2e, 0xe0, 0xaa, 0xf0, 0x94, 0xd3, 0x4a, 0x6b,
          0x7d, 0x45, 0xda, 0x56, 0x8c, 0x3e, 0x27, 0x9d, 0xcd, 0x38, 0x42,
          0x80, 0xa4, 0x0b, 0xad, 0xec, 0x69, 0x18, 0x6d, 0x82, 0x2a);
  VCMP_U8(9, v3, 0x19, 0x8f, 0x05, 0xf9, 0x71, 0xc3, 0xbb, 0x31, 0x57, 0x83,
          0x1a, 0xb2, 0x22, 0x63, 0xf7, 0x6c, 0x74, 0xab, 0x13, 0x5e, 0xdf,
          0x60, 0x7b, 0xc6, 0x91, 0x3c, 0xf5, 0xe8, 0xb9, 0x97, 0x51);

  VCLEAR(v1);
  VCLEAR(v2);
  VCLEAR(v3);
  stride = 3;
  VSET(21, e8, m1);
  asm volatile("vlsseg3e8.v v1, (%0), %1" ::"r"(INP1), "r"(stride));
  VCMP_U8(10, v1, 0x9f, 0x20, 0x05, 0xaa, 0xc3, 0xd3, 0x57, 0x7d, 0xb2, 0x56,
          0xf7, 0x27, 0xab, 0x38, 0xdf, 0xa4, 0xc6, 0xec, 0xf5, 0x6d, 0x97);
  VCMP_U8(11, v2, 0xe4, 0x8f, 0xe0, 0x71, 0x94, 0x31, 0x6b, 0x1a, 0xda, 0x63,
          0x3e, 0x74, 0xcd, 0x5e, 0x80, 0x7b, 0xad, 0x3c, 0x18, 0xb9, 0x2a);
  VCMP_U8(12, v3, 0x19, 0x2e, 0xf9, 0xf0, 0xbb, 0x4a, 0x83, 0x45, 0x22, 0x8c,
          0x6c, 0x9d, 0x13, 0x42, 0x60, 0x0b, 0x91, 0x69, 0xe8, 0x82, 0x51);

  VCLEAR(v1);
  VCLEAR(v2);
  VCLEAR(v3);
  stride = 4;
  VSET(16, e8, m1);
  asm volatile("vlsseg3e8.v v1, (%0), %1" ::"r"(INP1), "r"(stride));
  VCMP_U8(13, v1, 0x9f, 0x8f, 0xf9, 0xc3, 0x31, 0x83, 0xb2, 0x63, 0x6c, 0xab,
          0x5e, 0x60, 0xc6, 0x3c, 0xe8, 0x97);
  VCMP_U8(14, v2, 0xe4, 0x2e, 0xaa, 0x94, 0x4a, 0x7d, 0xda, 0x8c, 0x27, 0xcd,
          0x42, 0xa4, 0xad, 0x69, 0x6d, 0x2a);
  VCMP_U8(15, v3, 0x19, 0x05, 0x71, 0xbb, 0x57, 0x1a, 0x22, 0xf7, 0x74, 0x13,
          0xdf, 0x7b, 0x91, 0xf5, 0xb9, 0x51);
}

// Segment-4
void TEST_CASE3_8(void) {
  VSET(-1, e8, m1);
  volatile uint8_t INP1[] = {
      0x9f, 0xe4, 0x19, 0x20, 0x8f, 0x2e, 0x05, 0xe0, 0xf9, 0xaa, 0x71,
      0xf0, 0xc3, 0x94, 0xbb, 0xd3, 0x31, 0x4a, 0x57, 0x6b, 0x83, 0x7d,
      0x1a, 0x45, 0xb2, 0xda, 0x22, 0x56, 0x63, 0x8c, 0xf7, 0x3e, 0x6c,
      0x27, 0x74, 0x9d, 0xab, 0xcd, 0x13, 0x38, 0x5e, 0x42, 0xdf, 0x80,
      0x60, 0xa4, 0x7b, 0x0b, 0xc6, 0xad, 0x91, 0xec, 0x3c, 0x69, 0xf5,
      0x18, 0xe8, 0x6d, 0xb9, 0x82, 0x97, 0x2a, 0x51, 0x70};
  VCLEAR(v1);
  VCLEAR(v2);
  VCLEAR(v3);
  VCLEAR(v4);
  stride = 2;
  VSET(31, e8, m1);
  asm volatile("vlsseg4e8.v v1, (%0), %1" ::"r"(INP1), "r"(stride));
  VCMP_U8(16, v1, 0x9f, 0x19, 0x8f, 0x05, 0xf9, 0x71, 0xc3, 0xbb, 0x31, 0x57,
          0x83, 0x1a, 0xb2, 0x22, 0x63, 0xf7, 0x6c, 0x74, 0xab, 0x13, 0x5e,
          0xdf, 0x60, 0x7b, 0xc6, 0x91, 0x3c, 0xf5, 0xe8, 0xb9, 0x97);
  VCMP_U8(17, v2, 0xe4, 0x20, 0x2e, 0xe0, 0xaa, 0xf0, 0x94, 0xd3, 0x4a, 0x6b,
          0x7d, 0x45, 0xda, 0x56, 0x8c, 0x3e, 0x27, 0x9d, 0xcd, 0x38, 0x42,
          0x80, 0xa4, 0x0b, 0xad, 0xec, 0x69, 0x18, 0x6d, 0x82, 0x2a);
  VCMP_U8(18, v3, 0x19, 0x8f, 0x05, 0xf9, 0x71, 0xc3, 0xbb, 0x31, 0x57, 0x83,
          0x1a, 0xb2, 0x22, 0x63, 0xf7, 0x6c, 0x74, 0xab, 0x13, 0x5e, 0xdf,
          0x60, 0x7b, 0xc6, 0x91, 0x3c, 0xf5, 0xe8, 0xb9, 0x97, 0x51);
  VCMP_U8(19, v4, 0x20, 0x2e, 0xe0, 0xaa, 0xf0, 0x94, 0xd3, 0x4a, 0x6b, 0x7d,
          0x45, 0xda, 0x56, 0x8c, 0x3e, 0x27, 0x9d, 0xcd, 0x38, 0x42, 0x80,
          0xa4, 0x0b, 0xad, 0xec, 0x69, 0x18, 0x6d, 0x82, 0x2a, 0x70);

  VCLEAR(v1);
  VCLEAR(v2);
  VCLEAR(v3);
  VCLEAR(v4);
  stride = 3;
  VSET(21, e8, m1);
  asm volatile("vlsseg4e8.v v1, (%0), %1" ::"r"(INP1), "r"(stride));
  VCMP_U8(20, v1, 0x9f, 0x20, 0x05, 0xaa, 0xc3, 0xd3, 0x57, 0x7d, 0xb2, 0x56,
          0xf7, 0x27, 0xab, 0x38, 0xdf, 0xa4, 0xc6, 0xec, 0xf5, 0x6d, 0x97);
  VCMP_U8(21, v2, 0xe4, 0x8f, 0xe0, 0x71, 0x94, 0x31, 0x6b, 0x1a, 0xda, 0x63,
          0x3e, 0x74, 0xcd, 0x5e, 0x80, 0x7b, 0xad, 0x3c, 0x18, 0xb9, 0x2a);
  VCMP_U8(22, v3, 0x19, 0x2e, 0xf9, 0xf0, 0xbb, 0x4a, 0x83, 0x45, 0x22, 0x8c,
          0x6c, 0x9d, 0x13, 0x42, 0x60, 0x0b, 0x91, 0x69, 0xe8, 0x82, 0x51);
  VCMP_U8(23, v4, 0x20, 0x05, 0xaa, 0xc3, 0xd3, 0x57, 0x7d, 0xb2, 0x56, 0xf7,
          0x27, 0xab, 0x38, 0xdf, 0xa4, 0xc6, 0xec, 0xf5, 0x6d, 0x97, 0x70);

  VCLEAR(v1);
  VCLEAR(v2);
  VCLEAR(v3);
  VCLEAR(v4);
  stride = 4;
  VSET(15, e8, m1);
  asm volatile("vlsseg4e8.v v1, (%0), %1" ::"r"(INP1), "r"(stride));
  VCMP_U8(24, v1, 0x9f, 0x8f, 0xf9, 0xc3, 0x31, 0x83, 0xb2, 0x63, 0x6c, 0xab,
          0x5e, 0x60, 0xc6, 0x3c, 0xe8);
  VCMP_U8(25, v2, 0xe4, 0x2e, 0xaa, 0x94, 0x4a, 0x7d, 0xda, 0x8c, 0x27, 0xcd,
          0x42, 0xa4, 0xad, 0x69, 0x6d);
  VCMP_U8(26, v3, 0x19, 0x05, 0x71, 0xbb, 0x57, 0x1a, 0x22, 0xf7, 0x74, 0x13,
          0xdf, 0x7b, 0x91, 0xf5, 0xb9);
  VCMP_U8(27, v4, 0x20, 0xe0, 0xf0, 0xd3, 0x6b, 0x45, 0x56, 0x3e, 0x9d, 0x38,
          0x80, 0x0b, 0xec, 0x18, 0x82);
}

// Segment-8
void TEST_CASE4_8(void) {
  VSET(-1, e8, m1);
  volatile uint8_t INP1[] = {
      0x9f, 0xe4, 0x19, 0x20, 0x8f, 0x2e, 0x05, 0xe0, 0xf9, 0xaa, 0x71,
      0xf0, 0xc3, 0x94, 0xbb, 0xd3, 0x31, 0x4a, 0x57, 0x6b, 0x83, 0x7d,
      0x1a, 0x45, 0xb2, 0xda, 0x22, 0x56, 0x63, 0x8c, 0xf7, 0x3e, 0x6c,
      0x27, 0x74, 0x9d, 0xab, 0xcd, 0x13, 0x38, 0x5e, 0x42, 0xdf, 0x80,
      0x60, 0xa4, 0x7b, 0x0b, 0xc6, 0xad, 0x91, 0xec, 0x3c, 0x69, 0xf5,
      0x18, 0xe8, 0x6d, 0xb9, 0x82, 0x97, 0x2a, 0x51, 0x70};
  VCLEAR(v1);
  VCLEAR(v2);
  VCLEAR(v3);
  VCLEAR(v4);
  VCLEAR(v5);
  VCLEAR(v6);
  VCLEAR(v7);
  VCLEAR(v8);
  stride = 2;
  VSET(29, e8, m1);
  asm volatile("vlsseg8e8.v v1, (%0), %1" ::"r"(INP1), "r"(stride));
  VCMP_U8(28, v1, 0x9f, 0x19, 0x8f, 0x05, 0xf9, 0x71, 0xc3, 0xbb, 0x31, 0x57,
          0x83, 0x1a, 0xb2, 0x22, 0x63, 0xf7, 0x6c, 0x74, 0xab, 0x13, 0x5e,
          0xdf, 0x60, 0x7b, 0xc6, 0x91, 0x3c, 0xf5, 0xe8);
  VCMP_U8(29, v2, 0xe4, 0x20, 0x2e, 0xe0, 0xaa, 0xf0, 0x94, 0xd3, 0x4a, 0x6b,
          0x7d, 0x45, 0xda, 0x56, 0x8c, 0x3e, 0x27, 0x9d, 0xcd, 0x38, 0x42,
          0x80, 0xa4, 0x0b, 0xad, 0xec, 0x69, 0x18, 0x6d);
  VCMP_U8(30, v3, 0x19, 0x8f, 0x05, 0xf9, 0x71, 0xc3, 0xbb, 0x31, 0x57, 0x83,
          0x1a, 0xb2, 0x22, 0x63, 0xf7, 0x6c, 0x74, 0xab, 0x13, 0x5e, 0xdf,
          0x60, 0x7b, 0xc6, 0x91, 0x3c, 0xf5, 0xe8, 0xb9);
  VCMP_U8(31, v4, 0x20, 0x2e, 0xe0, 0xaa, 0xf0, 0x94, 0xd3, 0x4a, 0x6b, 0x7d,
          0x45, 0xda, 0x56, 0x8c, 0x3e, 0x27, 0x9d, 0xcd, 0x38, 0x42, 0x80,
          0xa4, 0x0b, 0xad, 0xec, 0x69, 0x18, 0x6d, 0x82);
  VCMP_U8(32, v5, 0x8f, 0x05, 0xf9, 0x71, 0xc3, 0xbb, 0x31, 0x57, 0x83, 0x1a,
          0xb2, 0x22, 0x63, 0xf7, 0x6c, 0x74, 0xab, 0x13, 0x5e, 0xdf, 0x60,
          0x7b, 0xc6, 0x91, 0x3c, 0xf5, 0xe8, 0xb9, 0x97);
  VCMP_U8(33, v6, 0x2e, 0xe0, 0xaa, 0xf0, 0x94, 0xd3, 0x4a, 0x6b, 0x7d, 0x45,
          0xda, 0x56, 0x8c, 0x3e, 0x27, 0x9d, 0xcd, 0x38, 0x42, 0x80, 0xa4,
          0x0b, 0xad, 0xec, 0x69, 0x18, 0x6d, 0x82, 0x2a);
  VCMP_U8(34, v7, 0x05, 0xf9, 0x71, 0xc3, 0xbb, 0x31, 0x57, 0x83, 0x1a, 0xb2,
          0x22, 0x63, 0xf7, 0x6c, 0x74, 0xab, 0x13, 0x5e, 0xdf, 0x60, 0x7b,
          0xc6, 0x91, 0x3c, 0xf5, 0xe8, 0xb9, 0x97, 0x51);
  VCMP_U8(35, v8, 0xe0, 0xaa, 0xf0, 0x94, 0xd3, 0x4a, 0x6b, 0x7d, 0x45, 0xda,
          0x56, 0x8c, 0x3e, 0x27, 0x9d, 0xcd, 0x38, 0x42, 0x80, 0xa4, 0x0b,
          0xad, 0xec, 0x69, 0x18, 0x6d, 0x82, 0x2a, 0x70);
}

// Segment-2
void TEST_CASE1_16(void) {

  VSET(-1, e16, m1);
  volatile uint16_t INP1[] = {
      0x1234, 0x5678, 0x9abc, 0xdef0, 0x1111, 0x2222, 0x3333, 0x4444,
      0x5555, 0x6666, 0x7777, 0x8888, 0x9999, 0xaaaa, 0xbbbb, 0xcccc,
      0xdddd, 0xeeee, 0xffff, 0x0101, 0x0202, 0x0303, 0x0404, 0x0505,
      0x0606, 0x0707, 0x0808, 0x0909, 0x0a0a, 0x0b0b, 0x0c0c, 0x0d0d,
      0x0e0e, 0x0f0f, 0x1010, 0x1111, 0x1212, 0x1313, 0x1414, 0x1515,
      0x1616, 0x1717, 0x1818, 0x1919, 0x1a1a, 0x1b1b, 0x1c1c, 0x1d1d,
      0x1e1e, 0x1f1f, 0x2020, 0x2121, 0x2222, 0x2323, 0x2424, 0x2525,
      0x2626, 0x2727, 0x2828, 0x2929, 0x2a2a, 0x2b2b, 0x2c2c, 0x2d2d};

  VCLEAR(v1);
  VCLEAR(v2);
  stride = 0;
  VSET(5, e16, m1);
  asm volatile("vlsseg2e16.v v1, (%0), %1" ::"r"(INP1), "r"(stride));
  VCMP_U16(36, v1, 0x1234, 0x1234, 0x1234, 0x1234, 0x1234);
  VCMP_U16(37, v2, 0x5678, 0x5678, 0x5678, 0x5678, 0x5678);

  VSET(-1, e16, m1);
  VCLEAR(v1);
  VCLEAR(v2);
  stride = 4;
  VSET(32, e16, m1);
  asm volatile("vlsseg2e16.v v1, (%0), %1" ::"r"(INP1), "r"(stride));
  VCMP_U16(38, v1, 0x1234, 0x9abc, 0x1111, 0x3333, 0x5555, 0x7777, 0x9999,
           0xbbbb, 0xdddd, 0xffff, 0x0202, 0x0404, 0x0606, 0x0808, 0x0a0a,
           0x0c0c, 0x0e0e, 0x1010, 0x1212, 0x1414, 0x1616, 0x1818, 0x1a1a,
           0x1c1c, 0x1e1e, 0x2020, 0x2222, 0x2424, 0x2626, 0x2828, 0x2a2a,
           0x2c2c);
  VCMP_U16(39, v2, 0x5678, 0xdef0, 0x2222, 0x4444, 0x6666, 0x8888, 0xaaaa,
           0xcccc, 0xeeee, 0x0101, 0x0303, 0x0505, 0x0707, 0x0909, 0x0b0b,
           0x0d0d, 0x0f0f, 0x1111, 0x1313, 0x1515, 0x1717, 0x1919, 0x1b1b,
           0x1d1d, 0x1f1f, 0x2121, 0x2323, 0x2525, 0x2727, 0x2929, 0x2b2b,
           0x2d2d);

  VSET(-1, e16, m1);
  VCLEAR(v1);
  VCLEAR(v2);
  stride = 6;
  VSET(22, e16, m1);
  asm volatile("vlsseg2e16.v v1, (%0), %1" ::"r"(INP1), "r"(stride));
  VCMP_U16(40, v1, 0x1234, 0xdef0, 0x3333, 0x6666, 0x9999, 0xcccc, 0xffff,
           0x303, 0x606, 0x909, 0xc0c, 0xf0f, 0x1212, 0x1515, 0x1818, 0x1b1b,
           0x1e1e, 0x2121, 0x2424, 0x2727, 0x2a2a, 0x2d2d);
  VCMP_U16(41, v2, 0x5678, 0x1111, 0x4444, 0x7777, 0xaaaa, 0xdddd, 0x101, 0x404,
           0x707, 0xa0a, 0xd0d, 0x1010, 0x1313, 0x1616, 0x1919, 0x1c1c, 0x1f1f,
           0x2222, 0x2525, 0x2828, 0x2b2b);

  VSET(-1, e16, m1);
  VCLEAR(v1);
  VCLEAR(v2);
  stride = 8;
  VSET(16, e16, m1);
  asm volatile("vlsseg2e16.v v1, (%0), %1" ::"r"(INP1), "r"(stride));
  VCMP_U16(42, v1, 0x1234, 0x1111, 0x5555, 0x9999, 0xdddd, 0x0202, 0x0606,
           0x0a0a, 0x0e0e, 0x1212, 0x1616, 0x1a1a, 0x1e1e, 0x2222, 0x2626,
           0x2a2a);
  VCMP_U16(43, v2, 0x5678, 0x2222, 0x6666, 0xaaaa, 0xeeee, 0x0303, 0x0707,
           0x0b0b, 0x0f0f, 0x1313, 0x1717, 0x1b1b, 0x1f1f, 0x2323, 0x2727,
           0x2b2b);
}

// Segment-3
void TEST_CASE2_16(void) {
  VSET(-1, e16, m1);
  volatile uint16_t INP1[] = {
      0x1234, 0x5678, 0x9abc, 0xdef0, 0x1111, 0x2222, 0x3333, 0x4444,
      0x5555, 0x6666, 0x7777, 0x8888, 0x9999, 0xaaaa, 0xbbbb, 0xcccc,
      0xdddd, 0xeeee, 0xffff, 0x0101, 0x0202, 0x0303, 0x0404, 0x0505,
      0x0606, 0x0707, 0x0808, 0x0909, 0x0a0a, 0x0b0b, 0x0c0c, 0x0d0d,
      0x0e0e, 0x0f0f, 0x1010, 0x1111, 0x1212, 0x1313, 0x1414, 0x1515,
      0x1616, 0x1717, 0x1818, 0x1919, 0x1a1a, 0x1b1b, 0x1c1c, 0x1d1d,
      0x1e1e, 0x1f1f, 0x2020, 0x2121, 0x2222, 0x2323, 0x2424, 0x2525,
      0x2626, 0x2727, 0x2828, 0x2929, 0x2a2a, 0x2b2b, 0x2c2c, 0x2d2d};
  VCLEAR(v1);
  VCLEAR(v2);
  VCLEAR(v3);
  stride = 4;
  VSET(31, e16, m1);
  asm volatile("vlsseg3e16.v v1, (%0), %1" ::"r"(INP1), "r"(stride));
  VCMP_U16(44, v1, 0x1234, 0x9abc, 0x1111, 0x3333, 0x5555, 0x7777, 0x9999,
           0xbbbb, 0xdddd, 0xffff, 0x0202, 0x0404, 0x0606, 0x0808, 0x0a0a,
           0x0c0c, 0x0e0e, 0x1010, 0x1212, 0x1414, 0x1616, 0x1818, 0x1a1a,
           0x1c1c, 0x1e1e, 0x2020, 0x2222, 0x2424, 0x2626, 0x2828, 0x2a2a);
  VCMP_U16(45, v2, 0x5678, 0xdef0, 0x2222, 0x4444, 0x6666, 0x8888, 0xaaaa,
           0xcccc, 0xeeee, 0x0101, 0x0303, 0x0505, 0x0707, 0x0909, 0x0b0b,
           0x0d0d, 0x0f0f, 0x1111, 0x1313, 0x1515, 0x1717, 0x1919, 0x1b1b,
           0x1d1d, 0x1f1f, 0x2121, 0x2323, 0x2525, 0x2727, 0x2929, 0x2b2b,
           0x2d2d);
  VCMP_U16(46, v3, 0x9abc, 0x1111, 0x3333, 0x5555, 0x7777, 0x9999, 0xbbbb,
           0xdddd, 0xffff, 0x0202, 0x0404, 0x0606, 0x0808, 0x0a0a, 0x0c0c,
           0x0e0e, 0x1010, 0x1212, 0x1414, 0x1616, 0x1818, 0x1a1a, 0x1c1c,
           0x1e1e, 0x2020, 0x2222, 0x2424, 0x2626, 0x2828, 0x2a2a, 0x2c2c);
  VCLEAR(v1);
  VCLEAR(v2);
  VCLEAR(v3);
  stride = 6;
  VSET(21, e16, m1);
  asm volatile("vlsseg3e16.v v1, (%0), %1" ::"r"(INP1), "r"(stride));
  VCMP_U16(47, v1, 0x1234, 0xdef0, 0x3333, 0x6666, 0x9999, 0xcccc, 0xffff,
           0x303, 0x606, 0x909, 0xc0c, 0xf0f, 0x1212, 0x1515, 0x1818, 0x1b1b,
           0x1e1e, 0x2121, 0x2424, 0x2727, 0x2a2a);
  VCMP_U16(48, v2, 0x5678, 0x1111, 0x4444, 0x7777, 0xaaaa, 0xdddd, 0x101, 0x404,
           0x707, 0xa0a, 0xd0d, 0x1010, 0x1313, 0x1616, 0x1919, 0x1c1c, 0x1f1f,
           0x2222, 0x2525, 0x2828, 0x2b2b);
  VCMP_U16(49, v3, 0x9abc, 0x2222, 0x5555, 0x8888, 0xbbbb, 0xeeee, 0x202, 0x505,
           0x808, 0xb0b, 0xe0e, 0x1111, 0x1414, 0x1717, 0x1a1a, 0x1d1d, 0x2020,
           0x2323, 0x2626, 0x2929, 0x2c2c);

  VCLEAR(v1);
  VCLEAR(v2);
  VCLEAR(v3);
  stride = 8;
  VSET(16, e16, m1);
  asm volatile("vlsseg3e16.v v1, (%0), %1" ::"r"(INP1), "r"(stride));
  VCMP_U16(50, v1, 0x1234, 0x1111, 0x5555, 0x9999, 0xdddd, 0x202, 0x606, 0xa0a,
           0xe0e, 0x1212, 0x1616, 0x1a1a, 0x1e1e, 0x2222, 0x2626, 0x2a2a);
  VCMP_U16(51, v2, 0x5678, 0x2222, 0x6666, 0xaaaa, 0xeeee, 0x303, 0x707, 0xb0b,
           0xf0f, 0x1313, 0x1717, 0x1b1b, 0x1f1f, 0x2323, 0x2727, 0x2b2b);
  VCMP_U16(52, v3, 0x9abc, 0x3333, 0x7777, 0xbbbb, 0xffff, 0x404, 0x808, 0xc0c,
           0x1010, 0x1414, 0x1818, 0x1c1c, 0x2020, 0x2424, 0x2828, 0x2c2c);
}

// Segment-4
void TEST_CASE3_16(void) {
  VSET(-1, e16, m1);
  volatile uint16_t INP1[] = {
      0x1234, 0x5678, 0x9abc, 0xdef0, 0x1111, 0x2222, 0x3333, 0x4444,
      0x5555, 0x6666, 0x7777, 0x8888, 0x9999, 0xaaaa, 0xbbbb, 0xcccc,
      0xdddd, 0xeeee, 0xffff, 0x0101, 0x0202, 0x0303, 0x0404, 0x0505,
      0x0606, 0x0707, 0x0808, 0x0909, 0x0a0a, 0x0b0b, 0x0c0c, 0x0d0d,
      0x0e0e, 0x0f0f, 0x1010, 0x1111, 0x1212, 0x1313, 0x1414, 0x1515,
      0x1616, 0x1717, 0x1818, 0x1919, 0x1a1a, 0x1b1b, 0x1c1c, 0x1d1d,
      0x1e1e, 0x1f1f, 0x2020, 0x2121, 0x2222, 0x2323, 0x2424, 0x2525,
      0x2626, 0x2727, 0x2828, 0x2929, 0x2a2a, 0x2b2b, 0x2c2c, 0x2d2d};

  VCLEAR(v1);
  VCLEAR(v2);
  VCLEAR(v3);
  VCLEAR(v4);
  stride = 4;
  VSET(32, e16, m1);
  asm volatile("vlsseg4e16.v v1, (%0), %1" ::"r"(INP1), "r"(stride));
  VCMP_U16(53, v1, 0x1234, 0x9abc, 0x1111, 0x3333, 0x5555, 0x7777, 0x9999,
           0xbbbb, 0xdddd, 0xffff, 0x202, 0x404, 0x606, 0x808, 0xa0a, 0xc0c,
           0xe0e, 0x1010, 0x1212, 0x1414, 0x1616, 0x1818, 0x1a1a, 0x1c1c,
           0x1e1e, 0x2020, 0x2222, 0x2424, 0x2626, 0x2828, 0x2a2a, 0x2c2c);
  VCMP_U16(54, v2, 0x5678, 0xdef0, 0x2222, 0x4444, 0x6666, 0x8888, 0xaaaa,
           0xcccc, 0xeeee, 0x101, 0x303, 0x505, 0x707, 0x909, 0xb0b, 0xd0d,
           0xf0f, 0x1111, 0x1313, 0x1515, 0x1717, 0x1919, 0x1b1b, 0x1d1d,
           0x1f1f, 0x2121, 0x2323, 0x2525, 0x2727, 0x2929, 0x2b2b, 0x2d2d);
  VCMP_U16(55, v3, 0x9abc, 0x1111, 0x3333, 0x5555, 0x7777, 0x9999, 0xbbbb,
           0xdddd, 0xffff, 0x202, 0x404, 0x606, 0x808, 0xa0a, 0xc0c, 0xe0e,
           0x1010, 0x1212, 0x1414, 0x1616, 0x1818, 0x1a1a, 0x1c1c, 0x1e1e,
           0x2020, 0x2222, 0x2424, 0x2626, 0x2828, 0x2a2a, 0x2c2c);
  VCMP_U16(56, v4, 0xdef0, 0x2222, 0x4444, 0x6666, 0x8888, 0xaaaa, 0xcccc,
           0xeeee, 0x101, 0x303, 0x505, 0x707, 0x909, 0xb0b, 0xd0d, 0xf0f,
           0x1111, 0x1313, 0x1515, 0x1717, 0x1919, 0x1b1b, 0x1d1d, 0x1f1f,
           0x2121, 0x2323, 0x2525, 0x2727, 0x2929, 0x2b2b, 0x2d2d);

  VCLEAR(v1);
  VCLEAR(v2);
  VCLEAR(v3);
  VCLEAR(v4);
  stride = 6;
  VSET(22, e16, m1);
  asm volatile("vlsseg4e16.v v1, (%0), %1" ::"r"(INP1), "r"(stride));
  VCMP_U16(57, v1, 0x1234, 0xdef0, 0x3333, 0x6666, 0x9999, 0xcccc, 0xffff,
           0x303, 0x606, 0x909, 0xc0c, 0xf0f, 0x1212, 0x1515, 0x1818, 0x1b1b,
           0x1e1e, 0x2121, 0x2424, 0x2727, 0x2a2a, 0x2d2d);
  VCMP_U16(58, v2, 0x5678, 0x1111, 0x4444, 0x7777, 0xaaaa, 0xdddd, 0x101, 0x404,
           0x707, 0xa0a, 0xd0d, 0x1010, 0x1313, 0x1616, 0x1919, 0x1c1c, 0x1f1f,
           0x2222, 0x2525, 0x2828, 0x2b2b);
  VCMP_U16(59, v3, 0x9abc, 0x2222, 0x5555, 0x8888, 0xbbbb, 0xeeee, 0x202, 0x505,
           0x808, 0xb0b, 0xe0e, 0x1111, 0x1414, 0x1717, 0x1a1a, 0x1d1d, 0x2020,
           0x2323, 0x2626, 0x2929, 0x2c2c);
  VCMP_U16(60, v4, 0xdef0, 0x3333, 0x6666, 0x9999, 0xcccc, 0xffff, 0x303, 0x606,
           0x909, 0xc0c, 0xf0f, 0x1212, 0x1515, 0x1818, 0x1b1b, 0x1e1e, 0x2121,
           0x2424, 0x2727, 0x2a2a, 0x2d2d);

  VCLEAR(v1);
  VCLEAR(v2);
  VCLEAR(v3);
  VCLEAR(v4);
  stride = 8;
  VSET(16, e16, m1);
  asm volatile("vlsseg4e16.v v1, (%0), %1" ::"r"(INP1), "r"(stride));
  VCMP_U16(61, v1, 0x1234, 0x1111, 0x5555, 0x9999, 0xdddd, 0x202, 0x606, 0xa0a,
           0xe0e, 0x1212, 0x1616, 0x1a1a, 0x1e1e, 0x2222, 0x2626, 0x2a2a);
  VCMP_U16(62, v2, 0x5678, 0x2222, 0x6666, 0xaaaa, 0xeeee, 0x303, 0x707, 0xb0b,
           0xf0f, 0x1313, 0x1717, 0x1b1b, 0x1f1f, 0x2323, 0x2727, 0x2b2b);
  VCMP_U16(63, v3, 0x9abc, 0x3333, 0x7777, 0xbbbb, 0xffff, 0x404, 0x808, 0xc0c,
           0x1010, 0x1414, 0x1818, 0x1c1c, 0x2020, 0x2424, 0x2828, 0x2c2c);
  VCMP_U16(64, v4, 0xdef0, 0x4444, 0x8888, 0xcccc, 0x101, 0x505, 0x909, 0xd0d,
           0x1111, 0x1515, 0x1919, 0x1d1d, 0x2121, 0x2525, 0x2929, 0x2d2d);
}

// Segment-8
void TEST_CASE4_16(void) {
  VSET(-1, e16, m1);
  volatile uint16_t INP1[] = {
      0x1234, 0x5678, 0x9abc, 0xdef0, 0x1111, 0x2222, 0x3333, 0x4444,
      0x5555, 0x6666, 0x7777, 0x8888, 0x9999, 0xaaaa, 0xbbbb, 0xcccc,
      0xdddd, 0xeeee, 0xffff, 0x0101, 0x0202, 0x0303, 0x0404, 0x0505,
      0x0606, 0x0707, 0x0808, 0x0909, 0x0a0a, 0x0b0b, 0x0c0c, 0x0d0d,
      0x0e0e, 0x0f0f, 0x1010, 0x1111, 0x1212, 0x1313, 0x1414, 0x1515,
      0x1616, 0x1717, 0x1818, 0x1919, 0x1a1a, 0x1b1b, 0x1c1c, 0x1d1d,
      0x1e1e, 0x1f1f, 0x2020, 0x2121, 0x2222, 0x2323, 0x2424, 0x2525,
      0x2626, 0x2727, 0x2828, 0x2929, 0x2a2a, 0x2b2b, 0x2c2c, 0x2d2d};

  VCLEAR(v1);
  VCLEAR(v2);
  VCLEAR(v3);
  VCLEAR(v4);
  VCLEAR(v5);
  VCLEAR(v6);
  VCLEAR(v7);
  VCLEAR(v8);
  stride = 4;
  VSET(32, e16, m1);
  asm volatile("vlsseg8e16.v v1, (%0), %1" ::"r"(INP1), "r"(stride));
  VCMP_U16(65, v1, 0x1234, 0x9abc, 0x1111, 0x3333, 0x5555, 0x7777, 0x9999,
           0xbbbb, 0xdddd, 0xffff, 0x202, 0x404, 0x606, 0x808, 0xa0a, 0xc0c,
           0xe0e, 0x1010, 0x1212, 0x1414, 0x1616, 0x1818, 0x1a1a, 0x1c1c,
           0x1e1e, 0x2020, 0x2222, 0x2424, 0x2626, 0x2828, 0x2a2a, 0x2c2c);
  VCMP_U16(66, v2, 0x5678, 0xdef0, 0x2222, 0x4444, 0x6666, 0x8888, 0xaaaa,
           0xcccc, 0xeeee, 0x101, 0x303, 0x505, 0x707, 0x909, 0xb0b, 0xd0d,
           0xf0f, 0x1111, 0x1313, 0x1515, 0x1717, 0x1919, 0x1b1b, 0x1d1d,
           0x1f1f, 0x2121, 0x2323, 0x2525, 0x2727, 0x2929, 0x2b2b, 0x2d2d);
  VCMP_U16(67, v3, 0x9abc, 0x1111, 0x3333, 0x5555, 0x7777, 0x9999, 0xbbbb,
           0xdddd, 0xffff, 0x202, 0x404, 0x606, 0x808, 0xa0a, 0xc0c, 0xe0e,
           0x1010, 0x1212, 0x1414, 0x1616, 0x1818, 0x1a1a, 0x1c1c, 0x1e1e,
           0x2020, 0x2222, 0x2424, 0x2626, 0x2828, 0x2a2a, 0x2c2c);
  VCMP_U16(68, v4, 0xdef0, 0x2222, 0x4444, 0x6666, 0x8888, 0xaaaa, 0xcccc,
           0xeeee, 0x101, 0x303, 0x505, 0x707, 0x909, 0xb0b, 0xd0d, 0xf0f,
           0x1111, 0x1313, 0x1515, 0x1717, 0x1919, 0x1b1b, 0x1d1d, 0x1f1f,
           0x2121, 0x2323, 0x2525, 0x2727, 0x2929, 0x2b2b, 0x2d2d);
  VCMP_U16(69, v5, 0x1111, 0x3333, 0x5555, 0x7777, 0x9999, 0xbbbb, 0xdddd,
           0xffff, 0x202, 0x404, 0x606, 0x808, 0xa0a, 0xc0c, 0xe0e, 0x1010,
           0x1212, 0x1414, 0x1616, 0x1818, 0x1a1a, 0x1c1c, 0x1e1e, 0x2020,
           0x2222, 0x2424, 0x2626, 0x2828, 0x2a2a, 0x2c2c);
  VCMP_U16(70, v6, 0x2222, 0x4444, 0x6666, 0x8888, 0xaaaa, 0xcccc, 0xeeee,
           0x101, 0x303, 0x505, 0x707, 0x909, 0xb0b, 0xd0d, 0xf0f, 0x1111,
           0x1313, 0x1515, 0x1717, 0x1919, 0x1b1b, 0x1d1d, 0x1f1f, 0x2121,
           0x2323, 0x2525, 0x2727, 0x2929, 0x2b2b, 0x2d2d);
  VCMP_U16(71, v7, 0x3333, 0x5555, 0x7777, 0x9999, 0xbbbb, 0xdddd, 0xffff,
           0x202, 0x404, 0x606, 0x808, 0xa0a, 0xc0c, 0xe0e, 0x1010, 0x1212,
           0x1414, 0x1616, 0x1818, 0x1a1a, 0x1c1c, 0x1e1e, 0x2020, 0x2222,
           0x2424, 0x2626, 0x2828, 0x2a2a, 0x2c2c);
  VCMP_U16(72, v8, 0x4444, 0x6666, 0x8888, 0xaaaa, 0xcccc, 0xeeee, 0x101, 0x303,
           0x505, 0x707, 0x909, 0xb0b, 0xd0d, 0xf0f, 0x1111, 0x1313, 0x1515,
           0x1717, 0x1919, 0x1b1b, 0x1d1d, 0x1f1f, 0x2121, 0x2323, 0x2525,
           0x2727, 0x2929, 0x2b2b, 0x2d2d);

  VCLEAR(v1);
  VCLEAR(v2);
  VCLEAR(v3);
  VCLEAR(v4);
  VCLEAR(v5);
  VCLEAR(v6);
  VCLEAR(v7);
  VCLEAR(v8);
  stride = 6;
  VSET(22, e16, m1);
  asm volatile("vlsseg8e16.v v1, (%0), %1" ::"r"(INP1), "r"(stride));
  VCMP_U16(73, v1, 0x1234, 0xdef0, 0x3333, 0x6666, 0x9999, 0xcccc, 0xffff,
           0x303, 0x606, 0x909, 0xc0c, 0xf0f, 0x1212, 0x1515, 0x1818, 0x1b1b,
           0x1e1e, 0x2121, 0x2424, 0x2727, 0x2a2a, 0x2d2d);
  VCMP_U16(74, v2, 0x5678, 0x1111, 0x4444, 0x7777, 0xaaaa, 0xdddd, 0x101, 0x404,
           0x707, 0xa0a, 0xd0d, 0x1010, 0x1313, 0x1616, 0x1919, 0x1c1c, 0x1f1f,
           0x2222, 0x2525, 0x2828, 0x2b2b);
  VCMP_U16(75, v3, 0x9abc, 0x2222, 0x5555, 0x8888, 0xbbbb, 0xeeee, 0x202, 0x505,
           0x808, 0xb0b, 0xe0e, 0x1111, 0x1414, 0x1717, 0x1a1a, 0x1d1d, 0x2020,
           0x2323, 0x2626, 0x2929, 0x2c2c);
  VCMP_U16(76, v4, 0xdef0, 0x3333, 0x6666, 0x9999, 0xcccc, 0xffff, 0x303, 0x606,
           0x909, 0xc0c, 0xf0f, 0x1212, 0x1515, 0x1818, 0x1b1b, 0x1e1e, 0x2121,
           0x2424, 0x2727, 0x2a2a, 0x2d2d);
  VCMP_U16(77, v5, 0x1111, 0x4444, 0x7777, 0xaaaa, 0xdddd, 0x101, 0x404, 0x707,
           0xa0a, 0xd0d, 0x1010, 0x1313, 0x1616, 0x1919, 0x1c1c, 0x1f1f, 0x2222,
           0x2525, 0x2828, 0x2b2b);
  VCMP_U16(78, v6, 0x2222, 0x5555, 0x8888, 0xbbbb, 0xeeee, 0x202, 0x505, 0x808,
           0xb0b, 0xe0e, 0x1111, 0x1414, 0x1717, 0x1a1a, 0x1d1d, 0x2020, 0x2323,
           0x2626, 0x2929, 0x2c2c);
  VCMP_U16(79, v7, 0x3333, 0x6666, 0x9999, 0xcccc, 0xffff, 0x303, 0x606, 0x909,
           0xc0c, 0xf0f, 0x1212, 0x1515, 0x1818, 0x1b1b, 0x1e1e, 0x2121, 0x2424,
           0x2727, 0x2a2a, 0x2d2d);
  VCMP_U16(80, v8, 0x4444, 0x7777, 0xaaaa, 0xdddd, 0x101, 0x404, 0x707, 0xa0a,
           0xd0d, 0x1010, 0x1313, 0x1616, 0x1919, 0x1c1c, 0x1f1f, 0x2222,
           0x2525, 0x2828, 0x2b2b);

  VCLEAR(v1);
  VCLEAR(v2);
  VCLEAR(v3);
  VCLEAR(v4);
  VCLEAR(v5);
  VCLEAR(v6);
  VCLEAR(v7);
  VCLEAR(v8);
  stride = 8;
  VSET(16, e16, m1);
  asm volatile("vlsseg8e16.v v1, (%0), %1" ::"r"(INP1), "r"(stride));
  VCMP_U16(81, v1, 0x1234, 0x1111, 0x5555, 0x9999, 0xdddd, 0x202, 0x606, 0xa0a,
           0xe0e, 0x1212, 0x1616, 0x1a1a, 0x1e1e, 0x2222, 0x2626, 0x2a2a);
  VCMP_U16(82, v2, 0x5678, 0x2222, 0x6666, 0xaaaa, 0xeeee, 0x303, 0x707, 0xb0b,
           0xf0f, 0x1313, 0x1717, 0x1b1b, 0x1f1f, 0x2323, 0x2727, 0x2b2b);
  VCMP_U16(83, v3, 0x9abc, 0x3333, 0x7777, 0xbbbb, 0xffff, 0x404, 0x808, 0xc0c,
           0x1010, 0x1414, 0x1818, 0x1c1c, 0x2020, 0x2424, 0x2828, 0x2c2c);
  VCMP_U16(84, v4, 0xdef0, 0x4444, 0x8888, 0xcccc, 0x101, 0x505, 0x909, 0xd0d,
           0x1111, 0x1515, 0x1919, 0x1d1d, 0x2121, 0x2525, 0x2929, 0x2d2d);
  VCMP_U16(85, v5, 0x1111, 0x5555, 0x9999, 0xdddd, 0x202, 0x606, 0xa0a, 0xe0e,
           0x1212, 0x1616, 0x1a1a, 0x1e1e, 0x2222, 0x2626, 0x2a2a);
  VCMP_U16(86, v6, 0x2222, 0x6666, 0xaaaa, 0xeeee, 0x303, 0x707, 0xb0b, 0xf0f,
           0x1313, 0x1717, 0x1b1b, 0x1f1f, 0x2323, 0x2727, 0x2b2b);
  VCMP_U16(87, v7, 0x3333, 0x7777, 0xbbbb, 0xffff, 0x404, 0x808, 0xc0c, 0x1010,
           0x1414, 0x1818, 0x1c1c, 0x2020, 0x2424, 0x2828, 0x2c2c);
  VCMP_U16(88, v8, 0x4444, 0x8888, 0xcccc, 0x101, 0x505, 0x909, 0xd0d, 0x1111,
           0x1515, 0x1919, 0x1d1d, 0x2121, 0x2525, 0x2929, 0x2d2d);
}

// Segment-2
void TEST_CASE1_32(void) {

  VSET(-1, e32, m1);
  volatile uint32_t INP1[] = {
      0xe19afa6b, 0x8c10145c, 0xbca44cc5, 0x11ffa54e, 0x82f92af6, 0x9af29daa,
      0x956eb527, 0x575c2e05, 0x68fb4cc5, 0xcf7a1d98, 0x53a0be4e, 0x26439a12,
      0x785cc853, 0x35659121, 0xf7a96b8c, 0xa87678a2, 0xb11d757e, 0x67dd4037,
      0xd29ad01e, 0xb7600abf, 0x2e572002, 0xaadc6195, 0xcefce71b, 0x64d90d0c,
      0x6c3b54b0, 0xcc6da682, 0xd8b7ae76, 0x8533b185, 0xa2cd798c, 0x2a4339cc,
      0xcf9238fb, 0x7e70281b, 0xdf162ee9, 0x4f2ea60f, 0x4b32bcdd, 0xbf3b8546,
      0x52b26ff5, 0x18cbcecd, 0xc364c8f8, 0x5bf0c67b, 0x60914005, 0x93265d9d,
      0xcff3c77d, 0x788529c3, 0xdda63ceb, 0x4edd7f48, 0xddcd4d07, 0x3266d631,
      0x3b2f25a6, 0x7bfd8a81, 0x9db64ef5, 0xa06a42d4, 0x687f8a39, 0xb9272633,
      0xb009319e, 0xf542d689, 0x45ef05c9, 0xf547c96e, 0x2a143e76, 0x17a38eec,
      0x9a73626c, 0xca064493, 0x582140dd, 0x97df3c7a};

  VCLEAR(v1);
  VCLEAR(v2);
  stride = 0;
  VSET(5, e32, m1);
  asm volatile("vlsseg2e32.v v1, (%0), %1" ::"r"(INP1), "r"(stride));
  VCMP_U32(89, v1, 0xe19afa6b, 0xe19afa6b, 0xe19afa6b, 0xe19afa6b, 0xe19afa6b);
  VCMP_U32(90, v2, 0x8c10145c, 0x8c10145c, 0x8c10145c, 0x8c10145c, 0x8c10145c);

  VSET(-1, e32, m1);
  VCLEAR(v1);
  VCLEAR(v2);
  stride = 8;
  VSET(32, e32, m1);
  asm volatile("vlsseg2e32.v v1, (%0), %1" ::"r"(INP1), "r"(stride));
  VCMP_U32(91, v1, 0xe19afa6b, 0xbca44cc5, 0x82f92af6, 0x956eb527, 0x68fb4cc5,
           0x53a0be4e, 0x785cc853, 0xf7a96b8c, 0xb11d757e, 0xd29ad01e,
           0x2e572002, 0xcefce71b, 0x6c3b54b0, 0xd8b7ae76, 0xa2cd798c,
           0xcf9238fb, 0xdf162ee9, 0x4b32bcdd, 0x52b26ff5, 0xc364c8f8,
           0x60914005, 0xcff3c77d, 0xdda63ceb, 0xddcd4d07, 0x3b2f25a6,
           0x9db64ef5, 0x687f8a39, 0xb009319e, 0x45ef05c9, 0x2a143e76,
           0x9a73626c, 0x582140dd);
  VCMP_U32(92, v2, 0x8c10145c, 0x11ffa54e, 0x9af29daa, 0x575c2e05, 0xcf7a1d98,
           0x26439a12, 0x35659121, 0xa87678a2, 0x67dd4037, 0xb7600abf,
           0xaadc6195, 0x64d90d0c, 0xcc6da682, 0x8533b185, 0x2a4339cc,
           0x7e70281b, 0x4f2ea60f, 0xbf3b8546, 0x18cbcecd, 0x5bf0c67b,
           0x93265d9d, 0x788529c3, 0x4edd7f48, 0x3266d631, 0x7bfd8a81,
           0xa06a42d4, 0xb9272633, 0xf542d689, 0xf547c96e, 0x17a38eec,
           0xca064493, 0x97df3c7a);

  VSET(-1, e32, m1);
  VCLEAR(v1);
  VCLEAR(v2);
  stride = 12;
  VSET(22, e32, m1);
  asm volatile("vlsseg2e32.v v1, (%0), %1" ::"r"(INP1), "r"(stride));
  VCMP_U32(93, v1, 0xe19afa6b, 0x11ffa54e, 0x956eb527, 0xcf7a1d98, 0x785cc853,
           0xa87678a2, 0xd29ad01e, 0xaadc6195, 0x6c3b54b0, 0x8533b185,
           0xcf9238fb, 0x4f2ea60f, 0x52b26ff5, 0x5bf0c67b, 0xcff3c77d,
           0x4edd7f48, 0x3b2f25a6, 0xa06a42d4, 0xb009319e, 0xf547c96e,
           0x9a73626c, 0x97df3c7a);
  VCMP_U32(94, v2, 0x8c10145c, 0x82f92af6, 0x575c2e05, 0x53a0be4e, 0x35659121,
           0xb11d757e, 0xb7600abf, 0xcefce71b, 0xcc6da682, 0xa2cd798c,
           0x7e70281b, 0x4b32bcdd, 0x18cbcecd, 0x60914005, 0x788529c3,
           0xddcd4d07, 0x7bfd8a81, 0x687f8a39, 0xf542d689, 0x2a143e76,
           0xca064493);

  VSET(-1, e32, m1);
  VCLEAR(v1);
  VCLEAR(v2);
  stride = 16;
  VSET(16, e32, m1);
  asm volatile("vlsseg2e32.v v1, (%0), %1" ::"r"(INP1), "r"(stride));
  VCMP_U32(95, v1, 0xe19afa6b, 0x82f92af6, 0x68fb4cc5, 0x785cc853, 0xb11d757e,
           0x2e572002, 0x6c3b54b0, 0xa2cd798c, 0xdf162ee9, 0x52b26ff5,
           0x60914005, 0xdda63ceb, 0x3b2f25a6, 0x687f8a39, 0x45ef05c9,
           0x9a73626c);
  VCMP_U32(96, v2, 0x8c10145c, 0x9af29daa, 0xcf7a1d98, 0x35659121, 0x67dd4037,
           0xaadc6195, 0xcc6da682, 0x2a4339cc, 0x4f2ea60f, 0x18cbcecd,
           0x93265d9d, 0x4edd7f48, 0x7bfd8a81, 0xb9272633, 0xf547c96e,
           0xca064493);
}

// Segment-3
void TEST_CASE2_32(void) {
  VSET(-1, e32, m1);
  volatile uint32_t INP1[] = {
      0xe19afa6b, 0x8c10145c, 0xbca44cc5, 0x11ffa54e, 0x82f92af6, 0x9af29daa,
      0x956eb527, 0x575c2e05, 0x68fb4cc5, 0xcf7a1d98, 0x53a0be4e, 0x26439a12,
      0x785cc853, 0x35659121, 0xf7a96b8c, 0xa87678a2, 0xb11d757e, 0x67dd4037,
      0xd29ad01e, 0xb7600abf, 0x2e572002, 0xaadc6195, 0xcefce71b, 0x64d90d0c,
      0x6c3b54b0, 0xcc6da682, 0xd8b7ae76, 0x8533b185, 0xa2cd798c, 0x2a4339cc,
      0xcf9238fb, 0x7e70281b, 0xdf162ee9, 0x4f2ea60f, 0x4b32bcdd, 0xbf3b8546,
      0x52b26ff5, 0x18cbcecd, 0xc364c8f8, 0x5bf0c67b, 0x60914005, 0x93265d9d,
      0xcff3c77d, 0x788529c3, 0xdda63ceb, 0x4edd7f48, 0xddcd4d07, 0x3266d631,
      0x3b2f25a6, 0x7bfd8a81, 0x9db64ef5, 0xa06a42d4, 0x687f8a39, 0xb9272633,
      0xb009319e, 0xf542d689, 0x45ef05c9, 0xf547c96e, 0x2a143e76, 0x17a38eec,
      0x9a73626c, 0xca064493, 0x582140dd, 0x97df3c7a};

  VCLEAR(v1);
  VCLEAR(v2);
  VCLEAR(v3);
  stride = 8;
  VSET(32, e32, m1);
  asm volatile("vlsseg3e32.v v1, (%0), %1" ::"r"(INP1), "r"(stride));
  VCMP_U32(97, v1, 0xe19afa6b, 0xbca44cc5, 0x82f92af6, 0x956eb527, 0x68fb4cc5,
           0x53a0be4e, 0x785cc853, 0xf7a96b8c, 0xb11d757e, 0xd29ad01e,
           0x2e572002, 0xcefce71b, 0x6c3b54b0, 0xd8b7ae76, 0xa2cd798c,
           0xcf9238fb, 0xdf162ee9, 0x4b32bcdd, 0x52b26ff5, 0xc364c8f8,
           0x60914005, 0xcff3c77d, 0xdda63ceb, 0xddcd4d07, 0x3b2f25a6,
           0x9db64ef5, 0x687f8a39, 0xb009319e, 0x45ef05c9, 0x2a143e76,
           0x9a73626c, 0x582140dd);
  VCMP_U32(98, v2, 0x8c10145c, 0x11ffa54e, 0x9af29daa, 0x575c2e05, 0xcf7a1d98,
           0x26439a12, 0x35659121, 0xa87678a2, 0x67dd4037, 0xb7600abf,
           0xaadc6195, 0x64d90d0c, 0xcc6da682, 0x8533b185, 0x2a4339cc,
           0x7e70281b, 0x4f2ea60f, 0xbf3b8546, 0x18cbcecd, 0x5bf0c67b,
           0x93265d9d, 0x788529c3, 0x4edd7f48, 0x3266d631, 0x7bfd8a81,
           0xa06a42d4, 0xb9272633, 0xf542d689, 0xf547c96e, 0x17a38eec,
           0xca064493, 0x97df3c7a);
  VCMP_U32(99, v3, 0xbca44cc5, 0x82f92af6, 0x956eb527, 0x68fb4cc5, 0x53a0be4e,
           0x785cc853, 0xf7a96b8c, 0xb11d757e, 0xd29ad01e, 0x2e572002,
           0xcefce71b, 0x6c3b54b0, 0xd8b7ae76, 0xa2cd798c, 0xcf9238fb,
           0xdf162ee9, 0x4b32bcdd, 0x52b26ff5, 0xc364c8f8, 0x60914005,
           0xcff3c77d, 0xdda63ceb, 0xddcd4d07, 0x3b2f25a6, 0x9db64ef5,
           0x687f8a39, 0xb009319e, 0x45ef05c9, 0x2a143e76, 0x9a73626c,
           0x582140dd);

  VCLEAR(v1);
  VCLEAR(v2);
  VCLEAR(v3);
  stride = 12;
  VSET(22, e32, m1);
  asm volatile("vlsseg3e32.v v1, (%0), %1" ::"r"(INP1), "r"(stride));
  VCMP_U32(100, v1, 0xe19afa6b, 0x11ffa54e, 0x956eb527, 0xcf7a1d98, 0x785cc853,
           0xa87678a2, 0xd29ad01e, 0xaadc6195, 0x6c3b54b0, 0x8533b185,
           0xcf9238fb, 0x4f2ea60f, 0x52b26ff5, 0x5bf0c67b, 0xcff3c77d,
           0x4edd7f48, 0x3b2f25a6, 0xa06a42d4, 0xb009319e, 0xf547c96e,
           0x9a73626c, 0x97df3c7a);
  VCMP_U32(101, v2, 0x8c10145c, 0x82f92af6, 0x575c2e05, 0x53a0be4e, 0x35659121,
           0xb11d757e, 0xb7600abf, 0xcefce71b, 0xcc6da682, 0xa2cd798c,
           0x7e70281b, 0x4b32bcdd, 0x18cbcecd, 0x60914005, 0x788529c3,
           0xddcd4d07, 0x7bfd8a81, 0x687f8a39, 0xf542d689, 0x2a143e76,
           0xca064493);
  VCMP_U32(102, v3, 0xbca44cc5, 0x9af29daa, 0x68fb4cc5, 0x26439a12, 0xf7a96b8c,
           0x67dd4037, 0x2e572002, 0x64d90d0c, 0xd8b7ae76, 0x2a4339cc,
           0xdf162ee9, 0xbf3b8546, 0xc364c8f8, 0x93265d9d, 0xdda63ceb,
           0x3266d631, 0x9db64ef5, 0xb9272633, 0x45ef05c9, 0x17a38eec,
           0x582140dd);

  VCLEAR(v1);
  VCLEAR(v2);
  VCLEAR(v3);
  stride = 16;
  VSET(16, e32, m1);
  asm volatile("vlsseg3e32.v v1, (%0), %1" ::"r"(INP1), "r"(stride));
  VCMP_U32(103, v1, 0xe19afa6b, 0x82f92af6, 0x68fb4cc5, 0x785cc853, 0xb11d757e,
           0x2e572002, 0x6c3b54b0, 0xa2cd798c, 0xdf162ee9, 0x52b26ff5,
           0x60914005, 0xdda63ceb, 0x3b2f25a6, 0x687f8a39, 0x45ef05c9,
           0x9a73626c);
  VCMP_U32(104, v2, 0x8c10145c, 0x9af29daa, 0xcf7a1d98, 0x35659121, 0x67dd4037,
           0xaadc6195, 0xcc6da682, 0x2a4339cc, 0x4f2ea60f, 0x18cbcecd,
           0x93265d9d, 0x4edd7f48, 0x7bfd8a81, 0xb9272633, 0xf547c96e,
           0xca064493);
  VCMP_U32(105, v3, 0xbca44cc5, 0x956eb527, 0x53a0be4e, 0xf7a96b8c, 0xd29ad01e,
           0xcefce71b, 0xd8b7ae76, 0xcf9238fb, 0x4b32bcdd, 0xc364c8f8,
           0xcff3c77d, 0xddcd4d07, 0x9db64ef5, 0xb009319e, 0x2a143e76,
           0x582140dd);
}

// Segment-4
void TEST_CASE3_32(void) {
  VSET(-1, e32, m1);
  volatile uint32_t INP1[] = {
      0xe19afa6b, 0x8c10145c, 0xbca44cc5, 0x11ffa54e, 0x82f92af6, 0x9af29daa,
      0x956eb527, 0x575c2e05, 0x68fb4cc5, 0xcf7a1d98, 0x53a0be4e, 0x26439a12,
      0x785cc853, 0x35659121, 0xf7a96b8c, 0xa87678a2, 0xb11d757e, 0x67dd4037,
      0xd29ad01e, 0xb7600abf, 0x2e572002, 0xaadc6195, 0xcefce71b, 0x64d90d0c,
      0x6c3b54b0, 0xcc6da682, 0xd8b7ae76, 0x8533b185, 0xa2cd798c, 0x2a4339cc,
      0xcf9238fb, 0x7e70281b, 0xdf162ee9, 0x4f2ea60f, 0x4b32bcdd, 0xbf3b8546,
      0x52b26ff5, 0x18cbcecd, 0xc364c8f8, 0x5bf0c67b, 0x60914005, 0x93265d9d,
      0xcff3c77d, 0x788529c3, 0xdda63ceb, 0x4edd7f48, 0xddcd4d07, 0x3266d631,
      0x3b2f25a6, 0x7bfd8a81, 0x9db64ef5, 0xa06a42d4, 0x687f8a39, 0xb9272633,
      0xb009319e, 0xf542d689, 0x45ef05c9, 0xf547c96e, 0x2a143e76, 0x17a38eec,
      0x9a73626c, 0xca064493, 0x582140dd, 0x97df3c7a};

  VCLEAR(v1);
  VCLEAR(v2);
  VCLEAR(v3);
  VCLEAR(v4);
  stride = 8;
  VSET(32, e32, m1);
  asm volatile("vlsseg4e32.v v1, (%0), %1" ::"r"(INP1), "r"(stride));
  VCMP_U32(106, v1, 0xe19afa6b, 0xbca44cc5, 0x82f92af6, 0x956eb527, 0x68fb4cc5,
           0x53a0be4e, 0x785cc853, 0xf7a96b8c, 0xb11d757e, 0xd29ad01e,
           0x2e572002, 0xcefce71b, 0x6c3b54b0, 0xd8b7ae76, 0xa2cd798c,
           0xcf9238fb, 0xdf162ee9, 0x4b32bcdd, 0x52b26ff5, 0xc364c8f8,
           0x60914005, 0xcff3c77d, 0xdda63ceb, 0xddcd4d07, 0x3b2f25a6,
           0x9db64ef5, 0x687f8a39, 0xb009319e, 0x45ef05c9, 0x2a143e76,
           0x9a73626c, 0x582140dd);
  VCMP_U32(107, v2, 0x8c10145c, 0x11ffa54e, 0x9af29daa, 0x575c2e05, 0xcf7a1d98,
           0x26439a12, 0x35659121, 0xa87678a2, 0x67dd4037, 0xb7600abf,
           0xaadc6195, 0x64d90d0c, 0xcc6da682, 0x8533b185, 0x2a4339cc,
           0x7e70281b, 0x4f2ea60f, 0xbf3b8546, 0x18cbcecd, 0x5bf0c67b,
           0x93265d9d, 0x788529c3, 0x4edd7f48, 0x3266d631, 0x7bfd8a81,
           0xa06a42d4, 0xb9272633, 0xf542d689, 0xf547c96e, 0x17a38eec,
           0xca064493, 0x97df3c7a);
  VCMP_U32(108, v3, 0xbca44cc5, 0x82f92af6, 0x956eb527, 0x68fb4cc5, 0x53a0be4e,
           0x785cc853, 0xf7a96b8c, 0xb11d757e, 0xd29ad01e, 0x2e572002,
           0xcefce71b, 0x6c3b54b0, 0xd8b7ae76, 0xa2cd798c, 0xcf9238fb,
           0xdf162ee9, 0x4b32bcdd, 0x52b26ff5, 0xc364c8f8, 0x60914005,
           0xcff3c77d, 0xdda63ceb, 0xddcd4d07, 0x3b2f25a6, 0x9db64ef5,
           0x687f8a39, 0xb009319e, 0x45ef05c9, 0x2a143e76, 0x9a73626c,
           0x582140dd);
  VCMP_U32(109, v4, 0x11ffa54e, 0x9af29daa, 0x575c2e05, 0xcf7a1d98, 0x26439a12,
           0x35659121, 0xa87678a2, 0x67dd4037, 0xb7600abf, 0xaadc6195,
           0x64d90d0c, 0xcc6da682, 0x8533b185, 0x2a4339cc, 0x7e70281b,
           0x4f2ea60f, 0xbf3b8546, 0x18cbcecd, 0x5bf0c67b, 0x93265d9d,
           0x788529c3, 0x4edd7f48, 0x3266d631, 0x7bfd8a81, 0xa06a42d4,
           0xb9272633, 0xf542d689, 0xf547c96e, 0x17a38eec, 0xca064493,
           0x97df3c7a);

  VCLEAR(v1);
  VCLEAR(v2);
  VCLEAR(v3);
  VCLEAR(v4);
  stride = 12;
  VSET(22, e32, m1);
  asm volatile("vlsseg4e32.v v1, (%0), %1" ::"r"(INP1), "r"(stride));
  VCMP_U32(110, v1, 0xe19afa6b, 0x11ffa54e, 0x956eb527, 0xcf7a1d98, 0x785cc853,
           0xa87678a2, 0xd29ad01e, 0xaadc6195, 0x6c3b54b0, 0x8533b185,
           0xcf9238fb, 0x4f2ea60f, 0x52b26ff5, 0x5bf0c67b, 0xcff3c77d,
           0x4edd7f48, 0x3b2f25a6, 0xa06a42d4, 0xb009319e, 0xf547c96e,
           0x9a73626c, 0x97df3c7a);
  VCMP_U32(111, v2, 0x8c10145c, 0x82f92af6, 0x575c2e05, 0x53a0be4e, 0x35659121,
           0xb11d757e, 0xb7600abf, 0xcefce71b, 0xcc6da682, 0xa2cd798c,
           0x7e70281b, 0x4b32bcdd, 0x18cbcecd, 0x60914005, 0x788529c3,
           0xddcd4d07, 0x7bfd8a81, 0x687f8a39, 0xf542d689, 0x2a143e76,
           0xca064493);
  VCMP_U32(112, v3, 0xbca44cc5, 0x9af29daa, 0x68fb4cc5, 0x26439a12, 0xf7a96b8c,
           0x67dd4037, 0x2e572002, 0x64d90d0c, 0xd8b7ae76, 0x2a4339cc,
           0xdf162ee9, 0xbf3b8546, 0xc364c8f8, 0x93265d9d, 0xdda63ceb,
           0x3266d631, 0x9db64ef5, 0xb9272633, 0x45ef05c9, 0x17a38eec,
           0x582140dd);
  VCMP_U32(113, v4, 0x11ffa54e, 0x956eb527, 0xcf7a1d98, 0x785cc853, 0xa87678a2,
           0xd29ad01e, 0xaadc6195, 0x6c3b54b0, 0x8533b185, 0xcf9238fb,
           0x4f2ea60f, 0x52b26ff5, 0x5bf0c67b, 0xcff3c77d, 0x4edd7f48,
           0x3b2f25a6, 0xa06a42d4, 0xb009319e, 0xf547c96e, 0x9a73626c,
           0x97df3c7a);

  VCLEAR(v1);
  VCLEAR(v2);
  VCLEAR(v3);
  VCLEAR(v4);
  stride = 16;
  VSET(16, e32, m1);
  asm volatile("vlsseg4e32.v v1, (%0), %1" ::"r"(INP1), "r"(stride));
  VCMP_U32(114, v1, 0xe19afa6b, 0x82f92af6, 0x68fb4cc5, 0x785cc853, 0xb11d757e,
           0x2e572002, 0x6c3b54b0, 0xa2cd798c, 0xdf162ee9, 0x52b26ff5,
           0x60914005, 0xdda63ceb, 0x3b2f25a6, 0x687f8a39, 0x45ef05c9,
           0x9a73626c);
  VCMP_U32(115, v2, 0x8c10145c, 0x9af29daa, 0xcf7a1d98, 0x35659121, 0x67dd4037,
           0xaadc6195, 0xcc6da682, 0x2a4339cc, 0x4f2ea60f, 0x18cbcecd,
           0x93265d9d, 0x4edd7f48, 0x7bfd8a81, 0xb9272633, 0xf547c96e,
           0xca064493);
  VCMP_U32(116, v3, 0xbca44cc5, 0x956eb527, 0x53a0be4e, 0xf7a96b8c, 0xd29ad01e,
           0xcefce71b, 0xd8b7ae76, 0xcf9238fb, 0x4b32bcdd, 0xc364c8f8,
           0xcff3c77d, 0xddcd4d07, 0x9db64ef5, 0xb009319e, 0x2a143e76,
           0x582140dd);
  VCMP_U32(117, v4, 0x11ffa54e, 0x575c2e05, 0x26439a12, 0xa87678a2, 0xb7600abf,
           0x64d90d0c, 0x8533b185, 0x7e70281b, 0xbf3b8546, 0x5bf0c67b,
           0x788529c3, 0x3266d631, 0xa06a42d4, 0xf542d689, 0x17a38eec,
           0x97df3c7a);
}

// Segment-8
void TEST_CASE4_32(void) {
  VSET(-1, e32, m1);
  volatile uint32_t INP1[] = {
      0xe19afa6b, 0x8c10145c, 0xbca44cc5, 0x11ffa54e, 0x82f92af6, 0x9af29daa,
      0x956eb527, 0x575c2e05, 0x68fb4cc5, 0xcf7a1d98, 0x53a0be4e, 0x26439a12,
      0x785cc853, 0x35659121, 0xf7a96b8c, 0xa87678a2, 0xb11d757e, 0x67dd4037,
      0xd29ad01e, 0xb7600abf, 0x2e572002, 0xaadc6195, 0xcefce71b, 0x64d90d0c,
      0x6c3b54b0, 0xcc6da682, 0xd8b7ae76, 0x8533b185, 0xa2cd798c, 0x2a4339cc,
      0xcf9238fb, 0x7e70281b, 0xdf162ee9, 0x4f2ea60f, 0x4b32bcdd, 0xbf3b8546,
      0x52b26ff5, 0x18cbcecd, 0xc364c8f8, 0x5bf0c67b, 0x60914005, 0x93265d9d,
      0xcff3c77d, 0x788529c3, 0xdda63ceb, 0x4edd7f48, 0xddcd4d07, 0x3266d631,
      0x3b2f25a6, 0x7bfd8a81, 0x9db64ef5, 0xa06a42d4, 0x687f8a39, 0xb9272633,
      0xb009319e, 0xf542d689, 0x45ef05c9, 0xf547c96e, 0x2a143e76, 0x17a38eec,
      0x9a73626c, 0xca064493, 0x582140dd, 0x97df3c7a};

  VCLEAR(v1);
  VCLEAR(v2);
  VCLEAR(v3);
  VCLEAR(v4);
  VCLEAR(v5);
  VCLEAR(v6);
  VCLEAR(v7);
  VCLEAR(v8);
  stride = 8;
  VSET(32, e32, m1);
  asm volatile("vlsseg8e32.v v1, (%0), %1" ::"r"(INP1), "r"(stride));
  VCMP_U32(118, v1, 0xe19afa6b, 0xbca44cc5, 0x82f92af6, 0x956eb527, 0x68fb4cc5,
           0x53a0be4e, 0x785cc853, 0xf7a96b8c, 0xb11d757e, 0xd29ad01e,
           0x2e572002, 0xcefce71b, 0x6c3b54b0, 0xd8b7ae76, 0xa2cd798c,
           0xcf9238fb, 0xdf162ee9, 0x4b32bcdd, 0x52b26ff5, 0xc364c8f8,
           0x60914005, 0xcff3c77d, 0xdda63ceb, 0xddcd4d07, 0x3b2f25a6,
           0x9db64ef5, 0x687f8a39, 0xb009319e, 0x45ef05c9, 0x2a143e76,
           0x9a73626c, 0x582140dd);
  VCMP_U32(119, v2, 0x8c10145c, 0x11ffa54e, 0x9af29daa, 0x575c2e05, 0xcf7a1d98,
           0x26439a12, 0x35659121, 0xa87678a2, 0x67dd4037, 0xb7600abf,
           0xaadc6195, 0x64d90d0c, 0xcc6da682, 0x8533b185, 0x2a4339cc,
           0x7e70281b, 0x4f2ea60f, 0xbf3b8546, 0x18cbcecd, 0x5bf0c67b,
           0x93265d9d, 0x788529c3, 0x4edd7f48, 0x3266d631, 0x7bfd8a81,
           0xa06a42d4, 0xb9272633, 0xf542d689, 0xf547c96e, 0x17a38eec,
           0xca064493, 0x97df3c7a);
  VCMP_U32(120, v3, 0xbca44cc5, 0x82f92af6, 0x956eb527, 0x68fb4cc5, 0x53a0be4e,
           0x785cc853, 0xf7a96b8c, 0xb11d757e, 0xd29ad01e, 0x2e572002,
           0xcefce71b, 0x6c3b54b0, 0xd8b7ae76, 0xa2cd798c, 0xcf9238fb,
           0xdf162ee9, 0x4b32bcdd, 0x52b26ff5, 0xc364c8f8, 0x60914005,
           0xcff3c77d, 0xdda63ceb, 0xddcd4d07, 0x3b2f25a6, 0x9db64ef5,
           0x687f8a39, 0xb009319e, 0x45ef05c9, 0x2a143e76, 0x9a73626c,
           0x582140dd);
  VCMP_U32(121, v4, 0x11ffa54e, 0x9af29daa, 0x575c2e05, 0xcf7a1d98, 0x26439a12,
           0x35659121, 0xa87678a2, 0x67dd4037, 0xb7600abf, 0xaadc6195,
           0x64d90d0c, 0xcc6da682, 0x8533b185, 0x2a4339cc, 0x7e70281b,
           0x4f2ea60f, 0xbf3b8546, 0x18cbcecd, 0x5bf0c67b, 0x93265d9d,
           0x788529c3, 0x4edd7f48, 0x3266d631, 0x7bfd8a81, 0xa06a42d4,
           0xb9272633, 0xf542d689, 0xf547c96e, 0x17a38eec, 0xca064493,
           0x97df3c7a);
  VCMP_U32(122, v5, 0x82f92af6, 0x956eb527, 0x68fb4cc5, 0x53a0be4e, 0x785cc853,
           0xf7a96b8c, 0xb11d757e, 0xd29ad01e, 0x2e572002, 0xcefce71b,
           0x6c3b54b0, 0xd8b7ae76, 0xa2cd798c, 0xcf9238fb, 0xdf162ee9,
           0x4b32bcdd, 0x52b26ff5, 0xc364c8f8, 0x60914005, 0xcff3c77d,
           0xdda63ceb, 0xddcd4d07, 0x3b2f25a6, 0x9db64ef5, 0x687f8a39,
           0xb009319e, 0x45ef05c9, 0x2a143e76, 0x9a73626c, 0x582140dd);
  VCMP_U32(123, v6, 0x9af29daa, 0x575c2e05, 0xcf7a1d98, 0x26439a12, 0x35659121,
           0xa87678a2, 0x67dd4037, 0xb7600abf, 0xaadc6195, 0x64d90d0c,
           0xcc6da682, 0x8533b185, 0x2a4339cc, 0x7e70281b, 0x4f2ea60f,
           0xbf3b8546, 0x18cbcecd, 0x5bf0c67b, 0x93265d9d, 0x788529c3,
           0x4edd7f48, 0x3266d631, 0x7bfd8a81, 0xa06a42d4, 0xb9272633,
           0xf542d689, 0xf547c96e, 0x17a38eec, 0xca064493, 0x97df3c7a);
  VCMP_U32(124, v7, 0x956eb527, 0x68fb4cc5, 0x53a0be4e, 0x785cc853, 0xf7a96b8c,
           0xb11d757e, 0xd29ad01e, 0x2e572002, 0xcefce71b, 0x6c3b54b0,
           0xd8b7ae76, 0xa2cd798c, 0xcf9238fb, 0xdf162ee9, 0x4b32bcdd,
           0x52b26ff5, 0xc364c8f8, 0x60914005, 0xcff3c77d, 0xdda63ceb,
           0xddcd4d07, 0x3b2f25a6, 0x9db64ef5, 0x687f8a39, 0xb009319e,
           0x45ef05c9, 0x2a143e76, 0x9a73626c, 0x582140dd);
  VCMP_U32(125, v8, 0x575c2e05, 0xcf7a1d98, 0x26439a12, 0x35659121, 0xa87678a2,
           0x67dd4037, 0xb7600abf, 0xaadc6195, 0x64d90d0c, 0xcc6da682,
           0x8533b185, 0x2a4339cc, 0x7e70281b, 0x4f2ea60f, 0xbf3b8546,
           0x18cbcecd, 0x5bf0c67b, 0x93265d9d, 0x788529c3, 0x4edd7f48,
           0x3266d631, 0x7bfd8a81, 0xa06a42d4, 0xb9272633, 0xf542d689,
           0xf547c96e, 0x17a38eec, 0xca064493, 0x97df3c7a);

  VCLEAR(v1);
  VCLEAR(v2);
  VCLEAR(v3);
  VCLEAR(v4);
  VCLEAR(v5);
  VCLEAR(v6);
  VCLEAR(v7);
  VCLEAR(v8);
  stride = 12;
  VSET(22, e32, m1);
  asm volatile("vlsseg8e32.v v1, (%0), %1" ::"r"(INP1), "r"(stride));
  VCMP_U32(126, v1, 0xe19afa6b, 0x11ffa54e, 0x956eb527, 0xcf7a1d98, 0x785cc853,
           0xa87678a2, 0xd29ad01e, 0xaadc6195, 0x6c3b54b0, 0x8533b185,
           0xcf9238fb, 0x4f2ea60f, 0x52b26ff5, 0x5bf0c67b, 0xcff3c77d,
           0x4edd7f48, 0x3b2f25a6, 0xa06a42d4, 0xb009319e, 0xf547c96e,
           0x9a73626c, 0x97df3c7a);
  VCMP_U32(127, v2, 0x8c10145c, 0x82f92af6, 0x575c2e05, 0x53a0be4e, 0x35659121,
           0xb11d757e, 0xb7600abf, 0xcefce71b, 0xcc6da682, 0xa2cd798c,
           0x7e70281b, 0x4b32bcdd, 0x18cbcecd, 0x60914005, 0x788529c3,
           0xddcd4d07, 0x7bfd8a81, 0x687f8a39, 0xf542d689, 0x2a143e76,
           0xca064493);
  VCMP_U32(128, v3, 0xbca44cc5, 0x9af29daa, 0x68fb4cc5, 0x26439a12, 0xf7a96b8c,
           0x67dd4037, 0x2e572002, 0x64d90d0c, 0xd8b7ae76, 0x2a4339cc,
           0xdf162ee9, 0xbf3b8546, 0xc364c8f8, 0x93265d9d, 0xdda63ceb,
           0x3266d631, 0x9db64ef5, 0xb9272633, 0x45ef05c9, 0x17a38eec,
           0x582140dd);
  VCMP_U32(129, v4, 0x11ffa54e, 0x956eb527, 0xcf7a1d98, 0x785cc853, 0xa87678a2,
           0xd29ad01e, 0xaadc6195, 0x6c3b54b0, 0x8533b185, 0xcf9238fb,
           0x4f2ea60f, 0x52b26ff5, 0x5bf0c67b, 0xcff3c77d, 0x4edd7f48,
           0x3b2f25a6, 0xa06a42d4, 0xb009319e, 0xf547c96e, 0x9a73626c,
           0x97df3c7a);
  VCMP_U32(130, v5, 0x82f92af6, 0x575c2e05, 0x53a0be4e, 0x35659121, 0xb11d757e,
           0xb7600abf, 0xcefce71b, 0xcc6da682, 0xa2cd798c, 0x7e70281b,
           0x4b32bcdd, 0x18cbcecd, 0x60914005, 0x788529c3, 0xddcd4d07,
           0x7bfd8a81, 0x687f8a39, 0xf542d689, 0x2a143e76, 0xca064493);
  VCMP_U32(131, v6, 0x9af29daa, 0x68fb4cc5, 0x26439a12, 0xf7a96b8c, 0x67dd4037,
           0x2e572002, 0x64d90d0c, 0xd8b7ae76, 0x2a4339cc, 0xdf162ee9,
           0xbf3b8546, 0xc364c8f8, 0x93265d9d, 0xdda63ceb, 0x3266d631,
           0x9db64ef5, 0xb9272633, 0x45ef05c9, 0x17a38eec, 0x582140dd);
  VCMP_U32(132, v7, 0x956eb527, 0xcf7a1d98, 0x785cc853, 0xa87678a2, 0xd29ad01e,
           0xaadc6195, 0x6c3b54b0, 0x8533b185, 0xcf9238fb, 0x4f2ea60f,
           0x52b26ff5, 0x5bf0c67b, 0xcff3c77d, 0x4edd7f48, 0x3b2f25a6,
           0xa06a42d4, 0xb009319e, 0xf547c96e, 0x9a73626c, 0x97df3c7a);
  VCMP_U32(133, v8, 0x575c2e05, 0x53a0be4e, 0x35659121, 0xb11d757e, 0xb7600abf,
           0xcefce71b, 0xcc6da682, 0xa2cd798c, 0x7e70281b, 0x4b32bcdd,
           0x18cbcecd, 0x60914005, 0x788529c3, 0xddcd4d07, 0x7bfd8a81,
           0x687f8a39, 0xf542d689, 0x2a143e76, 0xca064493);

  VCLEAR(v1);
  VCLEAR(v2);
  VCLEAR(v3);
  VCLEAR(v4);
  VCLEAR(v5);
  VCLEAR(v6);
  VCLEAR(v7);
  VCLEAR(v8);
  stride = 16;
  VSET(16, e32, m1);
  asm volatile("vlsseg8e32.v v1, (%0), %1" ::"r"(INP1), "r"(stride));
  VCMP_U32(134, v1, 0xe19afa6b, 0x82f92af6, 0x68fb4cc5, 0x785cc853, 0xb11d757e,
           0x2e572002, 0x6c3b54b0, 0xa2cd798c, 0xdf162ee9, 0x52b26ff5,
           0x60914005, 0xdda63ceb, 0x3b2f25a6, 0x687f8a39, 0x45ef05c9,
           0x9a73626c);
  VCMP_U32(135, v2, 0x8c10145c, 0x9af29daa, 0xcf7a1d98, 0x35659121, 0x67dd4037,
           0xaadc6195, 0xcc6da682, 0x2a4339cc, 0x4f2ea60f, 0x18cbcecd,
           0x93265d9d, 0x4edd7f48, 0x7bfd8a81, 0xb9272633, 0xf547c96e,
           0xca064493);
  VCMP_U32(136, v3, 0xbca44cc5, 0x956eb527, 0x53a0be4e, 0xf7a96b8c, 0xd29ad01e,
           0xcefce71b, 0xd8b7ae76, 0xcf9238fb, 0x4b32bcdd, 0xc364c8f8,
           0xcff3c77d, 0xddcd4d07, 0x9db64ef5, 0xb009319e, 0x2a143e76,
           0x582140dd);
  VCMP_U32(137, v4, 0x11ffa54e, 0x575c2e05, 0x26439a12, 0xa87678a2, 0xb7600abf,
           0x64d90d0c, 0x8533b185, 0x7e70281b, 0xbf3b8546, 0x5bf0c67b,
           0x788529c3, 0x3266d631, 0xa06a42d4, 0xf542d689, 0x17a38eec,
           0x97df3c7a);
  VCMP_U32(138, v5, 0x82f92af6, 0x68fb4cc5, 0x785cc853, 0xb11d757e, 0x2e572002,
           0x6c3b54b0, 0xa2cd798c, 0xdf162ee9, 0x52b26ff5, 0x60914005,
           0xdda63ceb, 0x3b2f25a6, 0x687f8a39, 0x45ef05c9, 0x9a73626c);
  VCMP_U32(139, v6, 0x9af29daa, 0xcf7a1d98, 0x35659121, 0x67dd4037, 0xaadc6195,
           0xcc6da682, 0x2a4339cc, 0x4f2ea60f, 0x18cbcecd, 0x93265d9d,
           0x4edd7f48, 0x7bfd8a81, 0xb9272633, 0xf547c96e, 0xca064493);
  VCMP_U32(140, v7, 0x956eb527, 0x53a0be4e, 0xf7a96b8c, 0xd29ad01e, 0xcefce71b,
           0xd8b7ae76, 0xcf9238fb, 0x4b32bcdd, 0xc364c8f8, 0xcff3c77d,
           0xddcd4d07, 0x9db64ef5, 0xb009319e, 0x2a143e76, 0x582140dd);
  VCMP_U32(141, v8, 0x575c2e05, 0x26439a12, 0xa87678a2, 0xb7600abf, 0x64d90d0c,
           0x8533b185, 0x7e70281b, 0xbf3b8546, 0x5bf0c67b, 0x788529c3,
           0x3266d631, 0xa06a42d4, 0xf542d689, 0x17a38eec, 0x97df3c7a);
}

// Segment-2
void TEST_CASE1_64(void) {

  VSET(-1, e64, m1);
  volatile uint64_t INP1[] = {
      0xfa3a99086b4b64aa, 0x57bb4a671118fdc0, 0xbb8df43b65bac0d2,
      0xa41351c301c72b5b, 0x511e175802d24608, 0x64d7a5514d544e52,
      0xbf1d53ca3e3c6bf7, 0xd31ac04eea8ecc07, 0x52edd3cfec205090,
      0x891a1820b423c29c, 0xfc8e3370b171c315, 0xa30da5c56e052f67,
      0x9f79ec1cdf33c0bc, 0x5d2c78d9927dfa33, 0x52b80462b7e072f9,
      0x3e0efee7a99a28e7, 0x3216edfad69d8286, 0x7409095aa2433e2e,
      0x45efda30062c904b, 0x2b707d3fbaef7019, 0xde9483fe82609c40,
      0x9d5e63fed3019ea6, 0xc4bae94e8d757c0f, 0x7c917722900ef4d8,
      0x693f603446fb64e6, 0x42cb1e2132c3d7d5, 0xd77ba2e13e47d589,
      0x45887508688c93b2, 0xac730ac471f57a8e, 0x708ca6623c11c1ff,
      0x90c7d0d2a8aa883c, 0xdb0427f14bb4d5ba, 0x3adf5823d1051252,
      0xc31b51ef18e6dc16, 0xa96c56ed56947466, 0x5e0f5c76fdd72450,
      0xada6b728b9b84f27, 0x9ef5b07ca6742028, 0x2d52c2213e1497ab,
      0x201b60e0fbbc4acd, 0x5428920ecca684b1, 0xc826aff176ba9a29,
      0x6f8c8820840f716e, 0x4a2bb5a96b1f24f5, 0x8aac4c04213d26aa,
      0xecd584f402152e19, 0x89f5805801f25a66, 0xbad7cab9c4062ffc,
      0xb6715b7275106bc1, 0x53112b0cc2123035, 0x8ec585926ed7af58,
      0xce4722d4b56cd330, 0x14041ab000c9c396, 0x928220385ce8c56d,
      0xdb402f4b0fd38776, 0x180002d7d73b1ae2, 0x76c882042e57f707,
      0xd13e73308658ad1f, 0x5142eb4c19644e7d, 0x23def41d77db2d38,
      0x34affa8555d23fd9, 0xa311951efe71188d, 0xf96089370f7fa0a7,
      0xb0899dfea0b44c26};

  VCLEAR(v1);
  VCLEAR(v2);
  stride = 0;
  VSET(5, e64, m1);
  asm volatile("vlsseg2e64.v v1, (%0), %1" ::"r"(INP1), "r"(stride));
  VCMP_U64(143, v1, 0xfa3a99086b4b64aa, 0xfa3a99086b4b64aa, 0xfa3a99086b4b64aa,
           0xfa3a99086b4b64aa, 0xfa3a99086b4b64aa);
  VCMP_U64(144, v2, 0x57bb4a671118fdc0, 0x57bb4a671118fdc0, 0x57bb4a671118fdc0,
           0x57bb4a671118fdc0, 0x57bb4a671118fdc0);

  VSET(-1, e64, m1);
  VCLEAR(v1);
  VCLEAR(v2);
  stride = 16;
  VSET(32, e64, m1);
  asm volatile("vlsseg2e64.v v1, (%0), %1" ::"r"(INP1), "r"(stride));
  VCMP_U64(145, v1, 0xfa3a99086b4b64aa, 0xbb8df43b65bac0d2, 0x511e175802d24608,
           0xbf1d53ca3e3c6bf7, 0x52edd3cfec205090, 0xfc8e3370b171c315,
           0x9f79ec1cdf33c0bc, 0x52b80462b7e072f9, 0x3216edfad69d8286,
           0x45efda30062c904b, 0xde9483fe82609c40, 0xc4bae94e8d757c0f,
           0x693f603446fb64e6, 0xd77ba2e13e47d589, 0xac730ac471f57a8e,
           0x90c7d0d2a8aa883c, 0x3adf5823d1051252, 0xa96c56ed56947466,
           0xada6b728b9b84f27, 0x2d52c2213e1497ab, 0x5428920ecca684b1,
           0x6f8c8820840f716e, 0x8aac4c04213d26aa, 0x89f5805801f25a66,
           0xb6715b7275106bc1, 0x8ec585926ed7af58, 0x14041ab000c9c396,
           0xdb402f4b0fd38776, 0x76c882042e57f707, 0x5142eb4c19644e7d,
           0x34affa8555d23fd9, 0xf96089370f7fa0a7);
  VCMP_U64(146, v2, 0x57bb4a671118fdc0, 0xa41351c301c72b5b, 0x64d7a5514d544e52,
           0xd31ac04eea8ecc07, 0x891a1820b423c29c, 0xa30da5c56e052f67,
           0x5d2c78d9927dfa33, 0x3e0efee7a99a28e7, 0x7409095aa2433e2e,
           0x2b707d3fbaef7019, 0x9d5e63fed3019ea6, 0x7c917722900ef4d8,
           0x42cb1e2132c3d7d5, 0x45887508688c93b2, 0x708ca6623c11c1ff,
           0xdb0427f14bb4d5ba, 0xc31b51ef18e6dc16, 0x5e0f5c76fdd72450,
           0x9ef5b07ca6742028, 0x201b60e0fbbc4acd, 0xc826aff176ba9a29,
           0x4a2bb5a96b1f24f5, 0xecd584f402152e19, 0xbad7cab9c4062ffc,
           0x53112b0cc2123035, 0xce4722d4b56cd330, 0x928220385ce8c56d,
           0x180002d7d73b1ae2, 0xd13e73308658ad1f, 0x23def41d77db2d38,
           0xa311951efe71188d, 0xb0899dfea0b44c26);

  VSET(-1, e64, m1);
  VCLEAR(v1);
  VCLEAR(v2);
  stride = 24;
  VSET(22, e64, m1);
  asm volatile("vlsseg2e64.v v1, (%0), %1" ::"r"(INP1), "r"(stride));
  VCMP_U64(149, v1, 0xfa3a99086b4b64aa, 0xa41351c301c72b5b, 0xbf1d53ca3e3c6bf7,
           0x891a1820b423c29c, 0x9f79ec1cdf33c0bc, 0x3e0efee7a99a28e7,
           0x45efda30062c904b, 0x9d5e63fed3019ea6, 0x693f603446fb64e6,
           0x45887508688c93b2, 0x90c7d0d2a8aa883c, 0xc31b51ef18e6dc16,
           0xada6b728b9b84f27, 0x201b60e0fbbc4acd, 0x6f8c8820840f716e,
           0xecd584f402152e19, 0xb6715b7275106bc1, 0xce4722d4b56cd330,
           0xdb402f4b0fd38776, 0xd13e73308658ad1f, 0x34affa8555d23fd9,
           0xb0899dfea0b44c26);
  VCMP_U64(150, v2, 0x57bb4a671118fdc0, 0x511e175802d24608, 0xd31ac04eea8ecc07,
           0xfc8e3370b171c315, 0x5d2c78d9927dfa33, 0x3216edfad69d8286,
           0x2b707d3fbaef7019, 0xc4bae94e8d757c0f, 0x42cb1e2132c3d7d5,
           0xac730ac471f57a8e, 0xdb0427f14bb4d5ba, 0xa96c56ed56947466,
           0x9ef5b07ca6742028, 0x5428920ecca684b1, 0x4a2bb5a96b1f24f5,
           0x89f5805801f25a66, 0x53112b0cc2123035, 0x14041ab000c9c396,
           0x180002d7d73b1ae2, 0x5142eb4c19644e7d, 0xa311951efe71188d);

  VSET(-1, e64, m1);
  VCLEAR(v1);
  VCLEAR(v2);
  stride = 32;
  VSET(16, e64, m1);
  asm volatile("vlsseg2e64.v v1, (%0), %1" ::"r"(INP1), "r"(stride));
  VCMP_U64(151, v1, 0xfa3a99086b4b64aa, 0x511e175802d24608, 0x52edd3cfec205090,
           0x9f79ec1cdf33c0bc, 0x3216edfad69d8286, 0xde9483fe82609c40,
           0x693f603446fb64e6, 0xac730ac471f57a8e, 0x3adf5823d1051252,
           0xada6b728b9b84f27, 0x5428920ecca684b1, 0x8aac4c04213d26aa,
           0xb6715b7275106bc1, 0x14041ab000c9c396, 0x76c882042e57f707,
           0x34affa8555d23fd9);
  VCMP_U64(152, v2, 0x57bb4a671118fdc0, 0x64d7a5514d544e52, 0x891a1820b423c29c,
           0x5d2c78d9927dfa33, 0x7409095aa2433e2e, 0x9d5e63fed3019ea6,
           0x42cb1e2132c3d7d5, 0x708ca6623c11c1ff, 0xc31b51ef18e6dc16,
           0x9ef5b07ca6742028, 0xc826aff176ba9a29, 0xecd584f402152e19,
           0x53112b0cc2123035, 0x928220385ce8c56d, 0xd13e73308658ad1f,
           0xa311951efe71188d);
}

// Segment-3
void TEST_CASE2_64(void) {
  VSET(-1, e64, m1);
  volatile uint64_t INP1[] = {
      0xfa3a99086b4b64aa, 0x57bb4a671118fdc0, 0xbb8df43b65bac0d2,
      0xa41351c301c72b5b, 0x511e175802d24608, 0x64d7a5514d544e52,
      0xbf1d53ca3e3c6bf7, 0xd31ac04eea8ecc07, 0x52edd3cfec205090,
      0x891a1820b423c29c, 0xfc8e3370b171c315, 0xa30da5c56e052f67,
      0x9f79ec1cdf33c0bc, 0x5d2c78d9927dfa33, 0x52b80462b7e072f9,
      0x3e0efee7a99a28e7, 0x3216edfad69d8286, 0x7409095aa2433e2e,
      0x45efda30062c904b, 0x2b707d3fbaef7019, 0xde9483fe82609c40,
      0x9d5e63fed3019ea6, 0xc4bae94e8d757c0f, 0x7c917722900ef4d8,
      0x693f603446fb64e6, 0x42cb1e2132c3d7d5, 0xd77ba2e13e47d589,
      0x45887508688c93b2, 0xac730ac471f57a8e, 0x708ca6623c11c1ff,
      0x90c7d0d2a8aa883c, 0xdb0427f14bb4d5ba, 0x3adf5823d1051252,
      0xc31b51ef18e6dc16, 0xa96c56ed56947466, 0x5e0f5c76fdd72450,
      0xada6b728b9b84f27, 0x9ef5b07ca6742028, 0x2d52c2213e1497ab,
      0x201b60e0fbbc4acd, 0x5428920ecca684b1, 0xc826aff176ba9a29,
      0x6f8c8820840f716e, 0x4a2bb5a96b1f24f5, 0x8aac4c04213d26aa,
      0xecd584f402152e19, 0x89f5805801f25a66, 0xbad7cab9c4062ffc,
      0xb6715b7275106bc1, 0x53112b0cc2123035, 0x8ec585926ed7af58,
      0xce4722d4b56cd330, 0x14041ab000c9c396, 0x928220385ce8c56d,
      0xdb402f4b0fd38776, 0x180002d7d73b1ae2, 0x76c882042e57f707,
      0xd13e73308658ad1f, 0x5142eb4c19644e7d, 0x23def41d77db2d38,
      0x34affa8555d23fd9, 0xa311951efe71188d, 0xf96089370f7fa0a7,
      0xb0899dfea0b44c26};

  VCLEAR(v1);
  VCLEAR(v2);
  VCLEAR(v3);
  stride = 16;
  VSET(32, e64, m1);
  asm volatile("vlsseg3e64.v v1, (%0), %1" ::"r"(INP1), "r"(stride));
  VCMP_U64(153, v1, 0xfa3a99086b4b64aa, 0xbb8df43b65bac0d2, 0x511e175802d24608,
           0xbf1d53ca3e3c6bf7, 0x52edd3cfec205090, 0xfc8e3370b171c315,
           0x9f79ec1cdf33c0bc, 0x52b80462b7e072f9, 0x3216edfad69d8286,
           0x45efda30062c904b, 0xde9483fe82609c40, 0xc4bae94e8d757c0f,
           0x693f603446fb64e6, 0xd77ba2e13e47d589, 0xac730ac471f57a8e,
           0x90c7d0d2a8aa883c, 0x3adf5823d1051252, 0xa96c56ed56947466,
           0xada6b728b9b84f27, 0x2d52c2213e1497ab, 0x5428920ecca684b1,
           0x6f8c8820840f716e, 0x8aac4c04213d26aa, 0x89f5805801f25a66,
           0xb6715b7275106bc1, 0x8ec585926ed7af58, 0x14041ab000c9c396,
           0xdb402f4b0fd38776, 0x76c882042e57f707, 0x5142eb4c19644e7d,
           0x34affa8555d23fd9, 0xf96089370f7fa0a7);
  VCMP_U64(154, v2, 0x57bb4a671118fdc0, 0xa41351c301c72b5b, 0x64d7a5514d544e52,
           0xd31ac04eea8ecc07, 0x891a1820b423c29c, 0xa30da5c56e052f67,
           0x5d2c78d9927dfa33, 0x3e0efee7a99a28e7, 0x7409095aa2433e2e,
           0x2b707d3fbaef7019, 0x9d5e63fed3019ea6, 0x7c917722900ef4d8,
           0x42cb1e2132c3d7d5, 0x45887508688c93b2, 0x708ca6623c11c1ff,
           0xdb0427f14bb4d5ba, 0xc31b51ef18e6dc16, 0x5e0f5c76fdd72450,
           0x9ef5b07ca6742028, 0x201b60e0fbbc4acd, 0xc826aff176ba9a29,
           0x4a2bb5a96b1f24f5, 0xecd584f402152e19, 0xbad7cab9c4062ffc,
           0x53112b0cc2123035, 0xce4722d4b56cd330, 0x928220385ce8c56d,
           0x180002d7d73b1ae2, 0xd13e73308658ad1f, 0x23def41d77db2d38,
           0xa311951efe71188d, 0xb0899dfea0b44c26);
  VCMP_U64(155, v3, 0xbb8df43b65bac0d2, 0x511e175802d24608, 0xbf1d53ca3e3c6bf7,
           0x52edd3cfec205090, 0xfc8e3370b171c315, 0x9f79ec1cdf33c0bc,
           0x52b80462b7e072f9, 0x3216edfad69d8286, 0x45efda30062c904b,
           0xde9483fe82609c40, 0xc4bae94e8d757c0f, 0x693f603446fb64e6,
           0xd77ba2e13e47d589, 0xac730ac471f57a8e, 0x90c7d0d2a8aa883c,
           0x3adf5823d1051252, 0xa96c56ed56947466, 0xada6b728b9b84f27,
           0x2d52c2213e1497ab, 0x5428920ecca684b1, 0x6f8c8820840f716e,
           0x8aac4c04213d26aa, 0x89f5805801f25a66, 0xb6715b7275106bc1,
           0x8ec585926ed7af58, 0x14041ab000c9c396, 0xdb402f4b0fd38776,
           0x76c882042e57f707, 0x5142eb4c19644e7d, 0x34affa8555d23fd9,
           0xf96089370f7fa0a7);

  VCLEAR(v1);
  VCLEAR(v2);
  VCLEAR(v3);
  stride = 24;
  VSET(22, e64, m1);
  asm volatile("vlsseg3e64.v v1, (%0), %1" ::"r"(INP1), "r"(stride));
  VCMP_U64(156, v1, 0xfa3a99086b4b64aa, 0xa41351c301c72b5b, 0xbf1d53ca3e3c6bf7,
           0x891a1820b423c29c, 0x9f79ec1cdf33c0bc, 0x3e0efee7a99a28e7,
           0x45efda30062c904b, 0x9d5e63fed3019ea6, 0x693f603446fb64e6,
           0x45887508688c93b2, 0x90c7d0d2a8aa883c, 0xc31b51ef18e6dc16,
           0xada6b728b9b84f27, 0x201b60e0fbbc4acd, 0x6f8c8820840f716e,
           0xecd584f402152e19, 0xb6715b7275106bc1, 0xce4722d4b56cd330,
           0xdb402f4b0fd38776, 0xd13e73308658ad1f, 0x34affa8555d23fd9,
           0xb0899dfea0b44c26);
  VCMP_U64(157, v2, 0x57bb4a671118fdc0, 0x511e175802d24608, 0xd31ac04eea8ecc07,
           0xfc8e3370b171c315, 0x5d2c78d9927dfa33, 0x3216edfad69d8286,
           0x2b707d3fbaef7019, 0xc4bae94e8d757c0f, 0x42cb1e2132c3d7d5,
           0xac730ac471f57a8e, 0xdb0427f14bb4d5ba, 0xa96c56ed56947466,
           0x9ef5b07ca6742028, 0x5428920ecca684b1, 0x4a2bb5a96b1f24f5,
           0x89f5805801f25a66, 0x53112b0cc2123035, 0x14041ab000c9c396,
           0x180002d7d73b1ae2, 0x5142eb4c19644e7d, 0xa311951efe71188d);
  VCMP_U64(158, v3, 0xbb8df43b65bac0d2, 0x64d7a5514d544e52, 0x52edd3cfec205090,
           0xa30da5c56e052f67, 0x52b80462b7e072f9, 0x7409095aa2433e2e,
           0xde9483fe82609c40, 0x7c917722900ef4d8, 0xd77ba2e13e47d589,
           0x708ca6623c11c1ff, 0x3adf5823d1051252, 0x5e0f5c76fdd72450,
           0x2d52c2213e1497ab, 0xc826aff176ba9a29, 0x8aac4c04213d26aa,
           0xbad7cab9c4062ffc, 0x8ec585926ed7af58, 0x928220385ce8c56d,
           0x76c882042e57f707, 0x23def41d77db2d38, 0xf96089370f7fa0a7);

  VCLEAR(v1);
  VCLEAR(v2);
  VCLEAR(v3);
  stride = 32;
  VSET(16, e64, m1);
  asm volatile("vlsseg3e64.v v1, (%0), %1" ::"r"(INP1), "r"(stride));
  VCMP_U64(159, v1, 0xfa3a99086b4b64aa, 0x511e175802d24608, 0x52edd3cfec205090,
           0x9f79ec1cdf33c0bc, 0x3216edfad69d8286, 0xde9483fe82609c40,
           0x693f603446fb64e6, 0xac730ac471f57a8e, 0x3adf5823d1051252,
           0xada6b728b9b84f27, 0x5428920ecca684b1, 0x8aac4c04213d26aa,
           0xb6715b7275106bc1, 0x14041ab000c9c396, 0x76c882042e57f707,
           0x34affa8555d23fd9);
  VCMP_U64(160, v2, 0x57bb4a671118fdc0, 0x64d7a5514d544e52, 0x891a1820b423c29c,
           0x5d2c78d9927dfa33, 0x7409095aa2433e2e, 0x9d5e63fed3019ea6,
           0x42cb1e2132c3d7d5, 0x708ca6623c11c1ff, 0xc31b51ef18e6dc16,
           0x9ef5b07ca6742028, 0xc826aff176ba9a29, 0xecd584f402152e19,
           0x53112b0cc2123035, 0x928220385ce8c56d, 0xd13e73308658ad1f,
           0xa311951efe71188d);
  VCMP_U64(161, v3, 0xbb8df43b65bac0d2, 0xbf1d53ca3e3c6bf7, 0xfc8e3370b171c315,
           0x52b80462b7e072f9, 0x45efda30062c904b, 0xc4bae94e8d757c0f,
           0xd77ba2e13e47d589, 0x90c7d0d2a8aa883c, 0xa96c56ed56947466,
           0x2d52c2213e1497ab, 0x6f8c8820840f716e, 0x89f5805801f25a66,
           0x8ec585926ed7af58, 0xdb402f4b0fd38776, 0x5142eb4c19644e7d,
           0xf96089370f7fa0a7);
}

// Segment-4
void TEST_CASE3_64(void) {
  VSET(-1, e64, m1);
  volatile uint64_t INP1[] = {
      0xfa3a99086b4b64aa, 0x57bb4a671118fdc0, 0xbb8df43b65bac0d2,
      0xa41351c301c72b5b, 0x511e175802d24608, 0x64d7a5514d544e52,
      0xbf1d53ca3e3c6bf7, 0xd31ac04eea8ecc07, 0x52edd3cfec205090,
      0x891a1820b423c29c, 0xfc8e3370b171c315, 0xa30da5c56e052f67,
      0x9f79ec1cdf33c0bc, 0x5d2c78d9927dfa33, 0x52b80462b7e072f9,
      0x3e0efee7a99a28e7, 0x3216edfad69d8286, 0x7409095aa2433e2e,
      0x45efda30062c904b, 0x2b707d3fbaef7019, 0xde9483fe82609c40,
      0x9d5e63fed3019ea6, 0xc4bae94e8d757c0f, 0x7c917722900ef4d8,
      0x693f603446fb64e6, 0x42cb1e2132c3d7d5, 0xd77ba2e13e47d589,
      0x45887508688c93b2, 0xac730ac471f57a8e, 0x708ca6623c11c1ff,
      0x90c7d0d2a8aa883c, 0xdb0427f14bb4d5ba, 0x3adf5823d1051252,
      0xc31b51ef18e6dc16, 0xa96c56ed56947466, 0x5e0f5c76fdd72450,
      0xada6b728b9b84f27, 0x9ef5b07ca6742028, 0x2d52c2213e1497ab,
      0x201b60e0fbbc4acd, 0x5428920ecca684b1, 0xc826aff176ba9a29,
      0x6f8c8820840f716e, 0x4a2bb5a96b1f24f5, 0x8aac4c04213d26aa,
      0xecd584f402152e19, 0x89f5805801f25a66, 0xbad7cab9c4062ffc,
      0xb6715b7275106bc1, 0x53112b0cc2123035, 0x8ec585926ed7af58,
      0xce4722d4b56cd330, 0x14041ab000c9c396, 0x928220385ce8c56d,
      0xdb402f4b0fd38776, 0x180002d7d73b1ae2, 0x76c882042e57f707,
      0xd13e73308658ad1f, 0x5142eb4c19644e7d, 0x23def41d77db2d38,
      0x34affa8555d23fd9, 0xa311951efe71188d, 0xf96089370f7fa0a7,
      0xb0899dfea0b44c26};

  VCLEAR(v1);
  VCLEAR(v2);
  VCLEAR(v3);
  VCLEAR(v4);
  stride = 16;
  VSET(32, e64, m1);
  asm volatile("vlsseg4e64.v v1, (%0), %1" ::"r"(INP1), "r"(stride));
  VCMP_U64(162, v1, 0xfa3a99086b4b64aa, 0xbb8df43b65bac0d2, 0x511e175802d24608,
           0xbf1d53ca3e3c6bf7, 0x52edd3cfec205090, 0xfc8e3370b171c315,
           0x9f79ec1cdf33c0bc, 0x52b80462b7e072f9, 0x3216edfad69d8286,
           0x45efda30062c904b, 0xde9483fe82609c40, 0xc4bae94e8d757c0f,
           0x693f603446fb64e6, 0xd77ba2e13e47d589, 0xac730ac471f57a8e,
           0x90c7d0d2a8aa883c, 0x3adf5823d1051252, 0xa96c56ed56947466,
           0xada6b728b9b84f27, 0x2d52c2213e1497ab, 0x5428920ecca684b1,
           0x6f8c8820840f716e, 0x8aac4c04213d26aa, 0x89f5805801f25a66,
           0xb6715b7275106bc1, 0x8ec585926ed7af58, 0x14041ab000c9c396,
           0xdb402f4b0fd38776, 0x76c882042e57f707, 0x5142eb4c19644e7d,
           0x34affa8555d23fd9, 0xf96089370f7fa0a7);
  VCMP_U64(163, v2, 0x57bb4a671118fdc0, 0xa41351c301c72b5b, 0x64d7a5514d544e52,
           0xd31ac04eea8ecc07, 0x891a1820b423c29c, 0xa30da5c56e052f67,
           0x5d2c78d9927dfa33, 0x3e0efee7a99a28e7, 0x7409095aa2433e2e,
           0x2b707d3fbaef7019, 0x9d5e63fed3019ea6, 0x7c917722900ef4d8,
           0x42cb1e2132c3d7d5, 0x45887508688c93b2, 0x708ca6623c11c1ff,
           0xdb0427f14bb4d5ba, 0xc31b51ef18e6dc16, 0x5e0f5c76fdd72450,
           0x9ef5b07ca6742028, 0x201b60e0fbbc4acd, 0xc826aff176ba9a29,
           0x4a2bb5a96b1f24f5, 0xecd584f402152e19, 0xbad7cab9c4062ffc,
           0x53112b0cc2123035, 0xce4722d4b56cd330, 0x928220385ce8c56d,
           0x180002d7d73b1ae2, 0xd13e73308658ad1f, 0x23def41d77db2d38,
           0xa311951efe71188d, 0xb0899dfea0b44c26);
  VCMP_U64(164, v3, 0xbb8df43b65bac0d2, 0x511e175802d24608, 0xbf1d53ca3e3c6bf7,
           0x52edd3cfec205090, 0xfc8e3370b171c315, 0x9f79ec1cdf33c0bc,
           0x52b80462b7e072f9, 0x3216edfad69d8286, 0x45efda30062c904b,
           0xde9483fe82609c40, 0xc4bae94e8d757c0f, 0x693f603446fb64e6,
           0xd77ba2e13e47d589, 0xac730ac471f57a8e, 0x90c7d0d2a8aa883c,
           0x3adf5823d1051252, 0xa96c56ed56947466, 0xada6b728b9b84f27,
           0x2d52c2213e1497ab, 0x5428920ecca684b1, 0x6f8c8820840f716e,
           0x8aac4c04213d26aa, 0x89f5805801f25a66, 0xb6715b7275106bc1,
           0x8ec585926ed7af58, 0x14041ab000c9c396, 0xdb402f4b0fd38776,
           0x76c882042e57f707, 0x5142eb4c19644e7d, 0x34affa8555d23fd9,
           0xf96089370f7fa0a7);
  VCMP_U64(165, v4, 0xa41351c301c72b5b, 0x64d7a5514d544e52, 0xd31ac04eea8ecc07,
           0x891a1820b423c29c, 0xa30da5c56e052f67, 0x5d2c78d9927dfa33,
           0x3e0efee7a99a28e7, 0x7409095aa2433e2e, 0x2b707d3fbaef7019,
           0x9d5e63fed3019ea6, 0x7c917722900ef4d8, 0x42cb1e2132c3d7d5,
           0x45887508688c93b2, 0x708ca6623c11c1ff, 0xdb0427f14bb4d5ba,
           0xc31b51ef18e6dc16, 0x5e0f5c76fdd72450, 0x9ef5b07ca6742028,
           0x201b60e0fbbc4acd, 0xc826aff176ba9a29, 0x4a2bb5a96b1f24f5,
           0xecd584f402152e19, 0xbad7cab9c4062ffc, 0x53112b0cc2123035,
           0xce4722d4b56cd330, 0x928220385ce8c56d, 0x180002d7d73b1ae2,
           0xd13e73308658ad1f, 0x23def41d77db2d38, 0xa311951efe71188d,
           0xb0899dfea0b44c26);

  VCLEAR(v1);
  VCLEAR(v2);
  VCLEAR(v3);
  VCLEAR(v4);
  stride = 24;
  VSET(22, e64, m1);
  asm volatile("vlsseg4e64.v v1, (%0), %1" ::"r"(INP1), "r"(stride));
  VCMP_U64(166, v1, 0xfa3a99086b4b64aa, 0xa41351c301c72b5b, 0xbf1d53ca3e3c6bf7,
           0x891a1820b423c29c, 0x9f79ec1cdf33c0bc, 0x3e0efee7a99a28e7,
           0x45efda30062c904b, 0x9d5e63fed3019ea6, 0x693f603446fb64e6,
           0x45887508688c93b2, 0x90c7d0d2a8aa883c, 0xc31b51ef18e6dc16,
           0xada6b728b9b84f27, 0x201b60e0fbbc4acd, 0x6f8c8820840f716e,
           0xecd584f402152e19, 0xb6715b7275106bc1, 0xce4722d4b56cd330,
           0xdb402f4b0fd38776, 0xd13e73308658ad1f, 0x34affa8555d23fd9,
           0xb0899dfea0b44c26);
  VCMP_U64(167, v2, 0x57bb4a671118fdc0, 0x511e175802d24608, 0xd31ac04eea8ecc07,
           0xfc8e3370b171c315, 0x5d2c78d9927dfa33, 0x3216edfad69d8286,
           0x2b707d3fbaef7019, 0xc4bae94e8d757c0f, 0x42cb1e2132c3d7d5,
           0xac730ac471f57a8e, 0xdb0427f14bb4d5ba, 0xa96c56ed56947466,
           0x9ef5b07ca6742028, 0x5428920ecca684b1, 0x4a2bb5a96b1f24f5,
           0x89f5805801f25a66, 0x53112b0cc2123035, 0x14041ab000c9c396,
           0x180002d7d73b1ae2, 0x5142eb4c19644e7d, 0xa311951efe71188d);
  VCMP_U64(168, v3, 0xbb8df43b65bac0d2, 0x64d7a5514d544e52, 0x52edd3cfec205090,
           0xa30da5c56e052f67, 0x52b80462b7e072f9, 0x7409095aa2433e2e,
           0xde9483fe82609c40, 0x7c917722900ef4d8, 0xd77ba2e13e47d589,
           0x708ca6623c11c1ff, 0x3adf5823d1051252, 0x5e0f5c76fdd72450,
           0x2d52c2213e1497ab, 0xc826aff176ba9a29, 0x8aac4c04213d26aa,
           0xbad7cab9c4062ffc, 0x8ec585926ed7af58, 0x928220385ce8c56d,
           0x76c882042e57f707, 0x23def41d77db2d38, 0xf96089370f7fa0a7);
  VCMP_U64(169, v4, 0xa41351c301c72b5b, 0xbf1d53ca3e3c6bf7, 0x891a1820b423c29c,
           0x9f79ec1cdf33c0bc, 0x3e0efee7a99a28e7, 0x45efda30062c904b,
           0x9d5e63fed3019ea6, 0x693f603446fb64e6, 0x45887508688c93b2,
           0x90c7d0d2a8aa883c, 0xc31b51ef18e6dc16, 0xada6b728b9b84f27,
           0x201b60e0fbbc4acd, 0x6f8c8820840f716e, 0xecd584f402152e19,
           0xb6715b7275106bc1, 0xce4722d4b56cd330, 0xdb402f4b0fd38776,
           0xd13e73308658ad1f, 0x34affa8555d23fd9, 0xb0899dfea0b44c26);

  VCLEAR(v1);
  VCLEAR(v2);
  VCLEAR(v3);
  VCLEAR(v4);
  stride = 32;
  VSET(16, e64, m1);
  asm volatile("vlsseg4e64.v v1, (%0), %1" ::"r"(INP1), "r"(stride));
  VCMP_U64(170, v1, 0xfa3a99086b4b64aa, 0x511e175802d24608, 0x52edd3cfec205090,
           0x9f79ec1cdf33c0bc, 0x3216edfad69d8286, 0xde9483fe82609c40,
           0x693f603446fb64e6, 0xac730ac471f57a8e, 0x3adf5823d1051252,
           0xada6b728b9b84f27, 0x5428920ecca684b1, 0x8aac4c04213d26aa,
           0xb6715b7275106bc1, 0x14041ab000c9c396, 0x76c882042e57f707,
           0x34affa8555d23fd9);
  VCMP_U64(171, v2, 0x57bb4a671118fdc0, 0x64d7a5514d544e52, 0x891a1820b423c29c,
           0x5d2c78d9927dfa33, 0x7409095aa2433e2e, 0x9d5e63fed3019ea6,
           0x42cb1e2132c3d7d5, 0x708ca6623c11c1ff, 0xc31b51ef18e6dc16,
           0x9ef5b07ca6742028, 0xc826aff176ba9a29, 0xecd584f402152e19,
           0x53112b0cc2123035, 0x928220385ce8c56d, 0xd13e73308658ad1f,
           0xa311951efe71188d);
  VCMP_U64(172, v3, 0xbb8df43b65bac0d2, 0xbf1d53ca3e3c6bf7, 0xfc8e3370b171c315,
           0x52b80462b7e072f9, 0x45efda30062c904b, 0xc4bae94e8d757c0f,
           0xd77ba2e13e47d589, 0x90c7d0d2a8aa883c, 0xa96c56ed56947466,
           0x2d52c2213e1497ab, 0x6f8c8820840f716e, 0x89f5805801f25a66,
           0x8ec585926ed7af58, 0xdb402f4b0fd38776, 0x5142eb4c19644e7d,
           0xf96089370f7fa0a7);
  VCMP_U64(173, v4, 0xa41351c301c72b5b, 0xd31ac04eea8ecc07, 0xa30da5c56e052f67,
           0x3e0efee7a99a28e7, 0x2b707d3fbaef7019, 0x7c917722900ef4d8,
           0x45887508688c93b2, 0xdb0427f14bb4d5ba, 0x5e0f5c76fdd72450,
           0x201b60e0fbbc4acd, 0x4a2bb5a96b1f24f5, 0xbad7cab9c4062ffc,
           0xce4722d4b56cd330, 0x180002d7d73b1ae2, 0x23def41d77db2d38,
           0xb0899dfea0b44c26);
}

// Segment-8
void TEST_CASE4_64(void) {
  VSET(-1, e64, m1);
  volatile uint64_t INP1[] = {
      0xfa3a99086b4b64aa, 0x57bb4a671118fdc0, 0xbb8df43b65bac0d2,
      0xa41351c301c72b5b, 0x511e175802d24608, 0x64d7a5514d544e52,
      0xbf1d53ca3e3c6bf7, 0xd31ac04eea8ecc07, 0x52edd3cfec205090,
      0x891a1820b423c29c, 0xfc8e3370b171c315, 0xa30da5c56e052f67,
      0x9f79ec1cdf33c0bc, 0x5d2c78d9927dfa33, 0x52b80462b7e072f9,
      0x3e0efee7a99a28e7, 0x3216edfad69d8286, 0x7409095aa2433e2e,
      0x45efda30062c904b, 0x2b707d3fbaef7019, 0xde9483fe82609c40,
      0x9d5e63fed3019ea6, 0xc4bae94e8d757c0f, 0x7c917722900ef4d8,
      0x693f603446fb64e6, 0x42cb1e2132c3d7d5, 0xd77ba2e13e47d589,
      0x45887508688c93b2, 0xac730ac471f57a8e, 0x708ca6623c11c1ff,
      0x90c7d0d2a8aa883c, 0xdb0427f14bb4d5ba, 0x3adf5823d1051252,
      0xc31b51ef18e6dc16, 0xa96c56ed56947466, 0x5e0f5c76fdd72450,
      0xada6b728b9b84f27, 0x9ef5b07ca6742028, 0x2d52c2213e1497ab,
      0x201b60e0fbbc4acd, 0x5428920ecca684b1, 0xc826aff176ba9a29,
      0x6f8c8820840f716e, 0x4a2bb5a96b1f24f5, 0x8aac4c04213d26aa,
      0xecd584f402152e19, 0x89f5805801f25a66, 0xbad7cab9c4062ffc,
      0xb6715b7275106bc1, 0x53112b0cc2123035, 0x8ec585926ed7af58,
      0xce4722d4b56cd330, 0x14041ab000c9c396, 0x928220385ce8c56d,
      0xdb402f4b0fd38776, 0x180002d7d73b1ae2, 0x76c882042e57f707,
      0xd13e73308658ad1f, 0x5142eb4c19644e7d, 0x23def41d77db2d38,
      0x34affa8555d23fd9, 0xa311951efe71188d, 0xf96089370f7fa0a7,
      0xb0899dfea0b44c26};

  VCLEAR(v1);
  VCLEAR(v2);
  VCLEAR(v3);
  VCLEAR(v4);
  VCLEAR(v5);
  VCLEAR(v6);
  VCLEAR(v7);
  VCLEAR(v8);
  stride = 16;
  VSET(32, e64, m1);
  asm volatile("vlsseg8e64.v v1, (%0), %1" ::"r"(INP1), "r"(stride));
  VCMP_U64(174, v1, 0xfa3a99086b4b64aa, 0xbb8df43b65bac0d2, 0x511e175802d24608,
           0xbf1d53ca3e3c6bf7, 0x52edd3cfec205090, 0xfc8e3370b171c315,
           0x9f79ec1cdf33c0bc, 0x52b80462b7e072f9, 0x3216edfad69d8286,
           0x45efda30062c904b, 0xde9483fe82609c40, 0xc4bae94e8d757c0f,
           0x693f603446fb64e6, 0xd77ba2e13e47d589, 0xac730ac471f57a8e,
           0x90c7d0d2a8aa883c, 0x3adf5823d1051252, 0xa96c56ed56947466,
           0xada6b728b9b84f27, 0x2d52c2213e1497ab, 0x5428920ecca684b1,
           0x6f8c8820840f716e, 0x8aac4c04213d26aa, 0x89f5805801f25a66,
           0xb6715b7275106bc1, 0x8ec585926ed7af58, 0x14041ab000c9c396,
           0xdb402f4b0fd38776, 0x76c882042e57f707, 0x5142eb4c19644e7d,
           0x34affa8555d23fd9, 0xf96089370f7fa0a7);
  VCMP_U64(175, v2, 0x57bb4a671118fdc0, 0xa41351c301c72b5b, 0x64d7a5514d544e52,
           0xd31ac04eea8ecc07, 0x891a1820b423c29c, 0xa30da5c56e052f67,
           0x5d2c78d9927dfa33, 0x3e0efee7a99a28e7, 0x7409095aa2433e2e,
           0x2b707d3fbaef7019, 0x9d5e63fed3019ea6, 0x7c917722900ef4d8,
           0x42cb1e2132c3d7d5, 0x45887508688c93b2, 0x708ca6623c11c1ff,
           0xdb0427f14bb4d5ba, 0xc31b51ef18e6dc16, 0x5e0f5c76fdd72450,
           0x9ef5b07ca6742028, 0x201b60e0fbbc4acd, 0xc826aff176ba9a29,
           0x4a2bb5a96b1f24f5, 0xecd584f402152e19, 0xbad7cab9c4062ffc,
           0x53112b0cc2123035, 0xce4722d4b56cd330, 0x928220385ce8c56d,
           0x180002d7d73b1ae2, 0xd13e73308658ad1f, 0x23def41d77db2d38,
           0xa311951efe71188d, 0xb0899dfea0b44c26);
  VCMP_U64(176, v3, 0xbb8df43b65bac0d2, 0x511e175802d24608, 0xbf1d53ca3e3c6bf7,
           0x52edd3cfec205090, 0xfc8e3370b171c315, 0x9f79ec1cdf33c0bc,
           0x52b80462b7e072f9, 0x3216edfad69d8286, 0x45efda30062c904b,
           0xde9483fe82609c40, 0xc4bae94e8d757c0f, 0x693f603446fb64e6,
           0xd77ba2e13e47d589, 0xac730ac471f57a8e, 0x90c7d0d2a8aa883c,
           0x3adf5823d1051252, 0xa96c56ed56947466, 0xada6b728b9b84f27,
           0x2d52c2213e1497ab, 0x5428920ecca684b1, 0x6f8c8820840f716e,
           0x8aac4c04213d26aa, 0x89f5805801f25a66, 0xb6715b7275106bc1,
           0x8ec585926ed7af58, 0x14041ab000c9c396, 0xdb402f4b0fd38776,
           0x76c882042e57f707, 0x5142eb4c19644e7d, 0x34affa8555d23fd9,
           0xf96089370f7fa0a7);
  VCMP_U64(177, v4, 0xa41351c301c72b5b, 0x64d7a5514d544e52, 0xd31ac04eea8ecc07,
           0x891a1820b423c29c, 0xa30da5c56e052f67, 0x5d2c78d9927dfa33,
           0x3e0efee7a99a28e7, 0x7409095aa2433e2e, 0x2b707d3fbaef7019,
           0x9d5e63fed3019ea6, 0x7c917722900ef4d8, 0x42cb1e2132c3d7d5,
           0x45887508688c93b2, 0x708ca6623c11c1ff, 0xdb0427f14bb4d5ba,
           0xc31b51ef18e6dc16, 0x5e0f5c76fdd72450, 0x9ef5b07ca6742028,
           0x201b60e0fbbc4acd, 0xc826aff176ba9a29, 0x4a2bb5a96b1f24f5,
           0xecd584f402152e19, 0xbad7cab9c4062ffc, 0x53112b0cc2123035,
           0xce4722d4b56cd330, 0x928220385ce8c56d, 0x180002d7d73b1ae2,
           0xd13e73308658ad1f, 0x23def41d77db2d38, 0xa311951efe71188d,
           0xb0899dfea0b44c26);
  VCMP_U64(178, v5, 0x511e175802d24608, 0xbf1d53ca3e3c6bf7, 0x52edd3cfec205090,
           0xfc8e3370b171c315, 0x9f79ec1cdf33c0bc, 0x52b80462b7e072f9,
           0x3216edfad69d8286, 0x45efda30062c904b, 0xde9483fe82609c40,
           0xc4bae94e8d757c0f, 0x693f603446fb64e6, 0xd77ba2e13e47d589,
           0xac730ac471f57a8e, 0x90c7d0d2a8aa883c, 0x3adf5823d1051252,
           0xa96c56ed56947466, 0xada6b728b9b84f27, 0x2d52c2213e1497ab,
           0x5428920ecca684b1, 0x6f8c8820840f716e, 0x8aac4c04213d26aa,
           0x89f5805801f25a66, 0xb6715b7275106bc1, 0x8ec585926ed7af58,
           0x14041ab000c9c396, 0xdb402f4b0fd38776, 0x76c882042e57f707,
           0x5142eb4c19644e7d, 0x34affa8555d23fd9, 0xf96089370f7fa0a7);
  VCMP_U64(179, v6, 0x64d7a5514d544e52, 0xd31ac04eea8ecc07, 0x891a1820b423c29c,
           0xa30da5c56e052f67, 0x5d2c78d9927dfa33, 0x3e0efee7a99a28e7,
           0x7409095aa2433e2e, 0x2b707d3fbaef7019, 0x9d5e63fed3019ea6,
           0x7c917722900ef4d8, 0x42cb1e2132c3d7d5, 0x45887508688c93b2,
           0x708ca6623c11c1ff, 0xdb0427f14bb4d5ba, 0xc31b51ef18e6dc16,
           0x5e0f5c76fdd72450, 0x9ef5b07ca6742028, 0x201b60e0fbbc4acd,
           0xc826aff176ba9a29, 0x4a2bb5a96b1f24f5, 0xecd584f402152e19,
           0xbad7cab9c4062ffc, 0x53112b0cc2123035, 0xce4722d4b56cd330,
           0x928220385ce8c56d, 0x180002d7d73b1ae2, 0xd13e73308658ad1f,
           0x23def41d77db2d38, 0xa311951efe71188d, 0xb0899dfea0b44c26);
  VCMP_U64(180, v7, 0xbf1d53ca3e3c6bf7, 0x52edd3cfec205090, 0xfc8e3370b171c315,
           0x9f79ec1cdf33c0bc, 0x52b80462b7e072f9, 0x3216edfad69d8286,
           0x45efda30062c904b, 0xde9483fe82609c40, 0xc4bae94e8d757c0f,
           0x693f603446fb64e6, 0xd77ba2e13e47d589, 0xac730ac471f57a8e,
           0x90c7d0d2a8aa883c, 0x3adf5823d1051252, 0xa96c56ed56947466,
           0xada6b728b9b84f27, 0x2d52c2213e1497ab, 0x5428920ecca684b1,
           0x6f8c8820840f716e, 0x8aac4c04213d26aa, 0x89f5805801f25a66,
           0xb6715b7275106bc1, 0x8ec585926ed7af58, 0x14041ab000c9c396,
           0xdb402f4b0fd38776, 0x76c882042e57f707, 0x5142eb4c19644e7d,
           0x34affa8555d23fd9, 0xf96089370f7fa0a7);
  VCMP_U64(181, v8, 0xd31ac04eea8ecc07, 0x891a1820b423c29c, 0xa30da5c56e052f67,
           0x5d2c78d9927dfa33, 0x3e0efee7a99a28e7, 0x7409095aa2433e2e,
           0x2b707d3fbaef7019, 0x9d5e63fed3019ea6, 0x7c917722900ef4d8,
           0x42cb1e2132c3d7d5, 0x45887508688c93b2, 0x708ca6623c11c1ff,
           0xdb0427f14bb4d5ba, 0xc31b51ef18e6dc16, 0x5e0f5c76fdd72450,
           0x9ef5b07ca6742028, 0x201b60e0fbbc4acd, 0xc826aff176ba9a29,
           0x4a2bb5a96b1f24f5, 0xecd584f402152e19, 0xbad7cab9c4062ffc,
           0x53112b0cc2123035, 0xce4722d4b56cd330, 0x928220385ce8c56d,
           0x180002d7d73b1ae2, 0xd13e73308658ad1f, 0x23def41d77db2d38,
           0xa311951efe71188d, 0xb0899dfea0b44c26);

  VCLEAR(v1);
  VCLEAR(v2);
  VCLEAR(v3);
  VCLEAR(v4);
  VCLEAR(v5);
  VCLEAR(v6);
  VCLEAR(v7);
  VCLEAR(v8);
  stride = 24;
  VSET(22, e64, m1);
  asm volatile("vlsseg8e64.v v1, (%0), %1" ::"r"(INP1), "r"(stride));
  VCMP_U64(182, v1, 0xfa3a99086b4b64aa, 0xa41351c301c72b5b, 0xbf1d53ca3e3c6bf7,
           0x891a1820b423c29c, 0x9f79ec1cdf33c0bc, 0x3e0efee7a99a28e7,
           0x45efda30062c904b, 0x9d5e63fed3019ea6, 0x693f603446fb64e6,
           0x45887508688c93b2, 0x90c7d0d2a8aa883c, 0xc31b51ef18e6dc16,
           0xada6b728b9b84f27, 0x201b60e0fbbc4acd, 0x6f8c8820840f716e,
           0xecd584f402152e19, 0xb6715b7275106bc1, 0xce4722d4b56cd330,
           0xdb402f4b0fd38776, 0xd13e73308658ad1f, 0x34affa8555d23fd9,
           0xb0899dfea0b44c26);
  VCMP_U64(183, v2, 0x57bb4a671118fdc0, 0x511e175802d24608, 0xd31ac04eea8ecc07,
           0xfc8e3370b171c315, 0x5d2c78d9927dfa33, 0x3216edfad69d8286,
           0x2b707d3fbaef7019, 0xc4bae94e8d757c0f, 0x42cb1e2132c3d7d5,
           0xac730ac471f57a8e, 0xdb0427f14bb4d5ba, 0xa96c56ed56947466,
           0x9ef5b07ca6742028, 0x5428920ecca684b1, 0x4a2bb5a96b1f24f5,
           0x89f5805801f25a66, 0x53112b0cc2123035, 0x14041ab000c9c396,
           0x180002d7d73b1ae2, 0x5142eb4c19644e7d, 0xa311951efe71188d);
  VCMP_U64(184, v3, 0xbb8df43b65bac0d2, 0x64d7a5514d544e52, 0x52edd3cfec205090,
           0xa30da5c56e052f67, 0x52b80462b7e072f9, 0x7409095aa2433e2e,
           0xde9483fe82609c40, 0x7c917722900ef4d8, 0xd77ba2e13e47d589,
           0x708ca6623c11c1ff, 0x3adf5823d1051252, 0x5e0f5c76fdd72450,
           0x2d52c2213e1497ab, 0xc826aff176ba9a29, 0x8aac4c04213d26aa,
           0xbad7cab9c4062ffc, 0x8ec585926ed7af58, 0x928220385ce8c56d,
           0x76c882042e57f707, 0x23def41d77db2d38, 0xf96089370f7fa0a7);
  VCMP_U64(185, v4, 0xa41351c301c72b5b, 0xbf1d53ca3e3c6bf7, 0x891a1820b423c29c,
           0x9f79ec1cdf33c0bc, 0x3e0efee7a99a28e7, 0x45efda30062c904b,
           0x9d5e63fed3019ea6, 0x693f603446fb64e6, 0x45887508688c93b2,
           0x90c7d0d2a8aa883c, 0xc31b51ef18e6dc16, 0xada6b728b9b84f27,
           0x201b60e0fbbc4acd, 0x6f8c8820840f716e, 0xecd584f402152e19,
           0xb6715b7275106bc1, 0xce4722d4b56cd330, 0xdb402f4b0fd38776,
           0xd13e73308658ad1f, 0x34affa8555d23fd9, 0xb0899dfea0b44c26);
  VCMP_U64(186, v5, 0x511e175802d24608, 0xd31ac04eea8ecc07, 0xfc8e3370b171c315,
           0x5d2c78d9927dfa33, 0x3216edfad69d8286, 0x2b707d3fbaef7019,
           0xc4bae94e8d757c0f, 0x42cb1e2132c3d7d5, 0xac730ac471f57a8e,
           0xdb0427f14bb4d5ba, 0xa96c56ed56947466, 0x9ef5b07ca6742028,
           0x5428920ecca684b1, 0x4a2bb5a96b1f24f5, 0x89f5805801f25a66,
           0x53112b0cc2123035, 0x14041ab000c9c396, 0x180002d7d73b1ae2,
           0x5142eb4c19644e7d, 0xa311951efe71188d);
  VCMP_U64(187, v6, 0x64d7a5514d544e52, 0x52edd3cfec205090, 0xa30da5c56e052f67,
           0x52b80462b7e072f9, 0x7409095aa2433e2e, 0xde9483fe82609c40,
           0x7c917722900ef4d8, 0xd77ba2e13e47d589, 0x708ca6623c11c1ff,
           0x3adf5823d1051252, 0x5e0f5c76fdd72450, 0x2d52c2213e1497ab,
           0xc826aff176ba9a29, 0x8aac4c04213d26aa, 0xbad7cab9c4062ffc,
           0x8ec585926ed7af58, 0x928220385ce8c56d, 0x76c882042e57f707,
           0x23def41d77db2d38, 0xf96089370f7fa0a7);
  VCMP_U64(188, v7, 0xbf1d53ca3e3c6bf7, 0x891a1820b423c29c, 0x9f79ec1cdf33c0bc,
           0x3e0efee7a99a28e7, 0x45efda30062c904b, 0x9d5e63fed3019ea6,
           0x693f603446fb64e6, 0x45887508688c93b2, 0x90c7d0d2a8aa883c,
           0xc31b51ef18e6dc16, 0xada6b728b9b84f27, 0x201b60e0fbbc4acd,
           0x6f8c8820840f716e, 0xecd584f402152e19, 0xb6715b7275106bc1,
           0xce4722d4b56cd330, 0xdb402f4b0fd38776, 0xd13e73308658ad1f,
           0x34affa8555d23fd9, 0xb0899dfea0b44c26);
  VCMP_U64(189, v8, 0xd31ac04eea8ecc07, 0xfc8e3370b171c315, 0x5d2c78d9927dfa33,
           0x3216edfad69d8286, 0x2b707d3fbaef7019, 0xc4bae94e8d757c0f,
           0x42cb1e2132c3d7d5, 0xac730ac471f57a8e, 0xdb0427f14bb4d5ba,
           0xa96c56ed56947466, 0x9ef5b07ca6742028, 0x5428920ecca684b1,
           0x4a2bb5a96b1f24f5, 0x89f5805801f25a66, 0x53112b0cc2123035,
           0x14041ab000c9c396, 0x180002d7d73b1ae2, 0x5142eb4c19644e7d,
           0xa311951efe71188d);

  VCLEAR(v1);
  VCLEAR(v2);
  VCLEAR(v3);
  VCLEAR(v4);
  VCLEAR(v5);
  VCLEAR(v6);
  VCLEAR(v7);
  VCLEAR(v8);
  stride = 32;
  VSET(16, e64, m1);
  asm volatile("vlsseg8e64.v v1, (%0), %1" ::"r"(INP1), "r"(stride));
  VCMP_U64(190, v1, 0xfa3a99086b4b64aa, 0x511e175802d24608, 0x52edd3cfec205090,
           0x9f79ec1cdf33c0bc, 0x3216edfad69d8286, 0xde9483fe82609c40,
           0x693f603446fb64e6, 0xac730ac471f57a8e, 0x3adf5823d1051252,
           0xada6b728b9b84f27, 0x5428920ecca684b1, 0x8aac4c04213d26aa,
           0xb6715b7275106bc1, 0x14041ab000c9c396, 0x76c882042e57f707,
           0x34affa8555d23fd9);
  VCMP_U64(191, v2, 0x57bb4a671118fdc0, 0x64d7a5514d544e52, 0x891a1820b423c29c,
           0x5d2c78d9927dfa33, 0x7409095aa2433e2e, 0x9d5e63fed3019ea6,
           0x42cb1e2132c3d7d5, 0x708ca6623c11c1ff, 0xc31b51ef18e6dc16,
           0x9ef5b07ca6742028, 0xc826aff176ba9a29, 0xecd584f402152e19,
           0x53112b0cc2123035, 0x928220385ce8c56d, 0xd13e73308658ad1f,
           0xa311951efe71188d);
  VCMP_U64(192, v3, 0xbb8df43b65bac0d2, 0xbf1d53ca3e3c6bf7, 0xfc8e3370b171c315,
           0x52b80462b7e072f9, 0x45efda30062c904b, 0xc4bae94e8d757c0f,
           0xd77ba2e13e47d589, 0x90c7d0d2a8aa883c, 0xa96c56ed56947466,
           0x2d52c2213e1497ab, 0x6f8c8820840f716e, 0x89f5805801f25a66,
           0x8ec585926ed7af58, 0xdb402f4b0fd38776, 0x5142eb4c19644e7d,
           0xf96089370f7fa0a7);
  VCMP_U64(193, v4, 0xa41351c301c72b5b, 0xd31ac04eea8ecc07, 0xa30da5c56e052f67,
           0x3e0efee7a99a28e7, 0x2b707d3fbaef7019, 0x7c917722900ef4d8,
           0x45887508688c93b2, 0xdb0427f14bb4d5ba, 0x5e0f5c76fdd72450,
           0x201b60e0fbbc4acd, 0x4a2bb5a96b1f24f5, 0xbad7cab9c4062ffc,
           0xce4722d4b56cd330, 0x180002d7d73b1ae2, 0x23def41d77db2d38,
           0xb0899dfea0b44c26);
  VCMP_U64(194, v5, 0x511e175802d24608, 0x52edd3cfec205090, 0x9f79ec1cdf33c0bc,
           0x3216edfad69d8286, 0xde9483fe82609c40, 0x693f603446fb64e6,
           0xac730ac471f57a8e, 0x3adf5823d1051252, 0xada6b728b9b84f27,
           0x5428920ecca684b1, 0x8aac4c04213d26aa, 0xb6715b7275106bc1,
           0x14041ab000c9c396, 0x76c882042e57f707, 0x34affa8555d23fd9);
  VCMP_U64(195, v6, 0x64d7a5514d544e52, 0x891a1820b423c29c, 0x5d2c78d9927dfa33,
           0x7409095aa2433e2e, 0x9d5e63fed3019ea6, 0x42cb1e2132c3d7d5,
           0x708ca6623c11c1ff, 0xc31b51ef18e6dc16, 0x9ef5b07ca6742028,
           0xc826aff176ba9a29, 0xecd584f402152e19, 0x53112b0cc2123035,
           0x928220385ce8c56d, 0xd13e73308658ad1f, 0xa311951efe71188d);
  VCMP_U64(196, v7, 0xbf1d53ca3e3c6bf7, 0xfc8e3370b171c315, 0x52b80462b7e072f9,
           0x45efda30062c904b, 0xc4bae94e8d757c0f, 0xd77ba2e13e47d589,
           0x90c7d0d2a8aa883c, 0xa96c56ed56947466, 0x2d52c2213e1497ab,
           0x6f8c8820840f716e, 0x89f5805801f25a66, 0x8ec585926ed7af58,
           0xdb402f4b0fd38776, 0x5142eb4c19644e7d, 0xf96089370f7fa0a7);
  VCMP_U64(197, v8, 0xd31ac04eea8ecc07, 0xa30da5c56e052f67, 0x3e0efee7a99a28e7,
           0x2b707d3fbaef7019, 0x7c917722900ef4d8, 0x45887508688c93b2,
           0xdb0427f14bb4d5ba, 0x5e0f5c76fdd72450, 0x201b60e0fbbc4acd,
           0x4a2bb5a96b1f24f5, 0xbad7cab9c4062ffc, 0xce4722d4b56cd330,
           0x180002d7d73b1ae2, 0x23def41d77db2d38, 0xb0899dfea0b44c26);
}

// Segment-4
void TEST_CASE3_32_m(void) {
  VSET(-1, e32, m1);
  volatile uint32_t INP1[] = {
      0xe19afa6b, 0x8c10145c, 0xbca44cc5, 0x11ffa54e, 0x82f92af6, 0x9af29daa,
      0x956eb527, 0x575c2e05, 0x68fb4cc5, 0xcf7a1d98, 0x53a0be4e, 0x26439a12,
      0x785cc853, 0x35659121, 0xf7a96b8c, 0xa87678a2, 0xb11d757e, 0x67dd4037,
      0xd29ad01e, 0xb7600abf, 0x2e572002, 0xaadc6195, 0xcefce71b, 0x64d90d0c,
      0x6c3b54b0, 0xcc6da682, 0xd8b7ae76, 0x8533b185, 0xa2cd798c, 0x2a4339cc,
      0xcf9238fb, 0x7e70281b, 0xdf162ee9, 0x4f2ea60f, 0x4b32bcdd, 0xbf3b8546,
      0x52b26ff5, 0x18cbcecd, 0xc364c8f8, 0x5bf0c67b, 0x60914005, 0x93265d9d,
      0xcff3c77d, 0x788529c3, 0xdda63ceb, 0x4edd7f48, 0xddcd4d07, 0x3266d631,
      0x3b2f25a6, 0x7bfd8a81, 0x9db64ef5, 0xa06a42d4, 0x687f8a39, 0xb9272633,
      0xb009319e, 0xf542d689, 0x45ef05c9, 0xf547c96e, 0x2a143e76, 0x17a38eec,
      0x9a73626c, 0xca064493, 0x582140dd, 0x97df3c7a};

  VCLEAR(v1);
  VCLEAR(v2);
  VCLEAR(v3);
  VCLEAR(v4);
  stride = 16;
  VSET(2, e32, m1);
  VLOAD_8(v0, 0x0F, 0xAA);
  VSET(16, e32, m1);
  asm volatile("vlsseg4e32.v v1, (%0), %1, v0.t" ::"r"(INP1), "r"(stride));
  VCMP_U32(198, v1, 0xe19afa6b, 0x82f92af6, 0x68fb4cc5, 0x785cc853, 0, 0, 0, 0,
           0, 0x52b26ff5, 0, 0xdda63ceb, 0, 0x687f8a39, 0, 0x9a73626c);
  VCMP_U32(199, v2, 0x8c10145c, 0x9af29daa, 0xcf7a1d98, 0x35659121, 0, 0, 0, 0,
           0, 0x18cbcecd, 0, 0x4edd7f48, 0, 0xb9272633, 0, 0xca064493);
  VCMP_U32(200, v3, 0xbca44cc5, 0x956eb527, 0x53a0be4e, 0xf7a96b8c, 0, 0, 0, 0,
           0, 0xc364c8f8, 0, 0xddcd4d07, 0, 0xb009319e, 0, 0x582140dd);
  VCMP_U32(201, v4, 0x11ffa54e, 0x575c2e05, 0x26439a12, 0xa87678a2, 0, 0, 0, 0,
           0, 0x5bf0c67b, 0, 0x3266d631, 0, 0xf542d689, 0, 0x97df3c7a);
}

int main(void) {
  INIT_CHECK();
  enable_vec();

  TEST_CASE1_8();
  TEST_CASE2_8();
  TEST_CASE3_8();
  TEST_CASE4_8();

  TEST_CASE1_16();
  TEST_CASE2_16();
  TEST_CASE3_16();
  TEST_CASE4_16();

  TEST_CASE1_32();
  TEST_CASE2_32();
  TEST_CASE3_32();
  TEST_CASE4_32();

  TEST_CASE1_64();
  TEST_CASE2_64();
  TEST_CASE3_64();
  TEST_CASE4_64();

  //  TEST_CASE3_32_m(); // Todo: fix masked mem ops

  EXIT_CHECK();
}
